简体   繁体   English

DataSourceAttribute的工作原理

[英]How DataSourceAttribute Works

I have defined a DataSource to specific table as in the next code: 我已经将DataSource定义为特定的表,如下一个代码所示:

[DataSource("System.Data.Odbc",
"Dsn=R10;Uid=sa;Pwd=Abcd1234@;Integrated Security=True;Connect Timeout=30;User Instance=True;",
"Products",
 DataAccessMethod.Sequential)]

When the datasource gets the data from table, does it upload to the cache all the rows of the table or the datasource works with bulks. 当数据源从表中获取数据时,它是否上传到缓存中表的所有行或数据源都使用批量处理。

If it does work with bulks, is there a way to control on the bulk size? 如果它适用于批量生产,有没有办法控制批量?

According to documentation , entire data set is loaded before any test is run: 根据文档 ,在运行任何测试之前加载整个数据集:

The data source cannot be changed based on input during a test because all the data is loaded and cached before the first test runs. 在测试期间无法根据输入更改数据源,因为在第一次测试运行之前会加载和缓存所有数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM