0
QueryWithRowMapperDelegateで結果セットを返し、クラスの異なるフィールドにマッピングされた列をマッピングしました。以下のコードスニペットは、私のコードと非常によく似ています。これは、返された少量の行でうまく動作しますが、ResultSetが3400+の行で構成される場合、それを繰り返し処理するのに時間がかかります。これは単にこのメソッドを使用する際の制限ですか?QueryWithRowMapperDelegateパフォーマンスの問題 - 代替ソリューション
代替ソリューションはありますか? ResultSetExtractorDelegate<Customer>
List<Customer> customers = Ado.AdoTemplate.QueryWithRowMapperDelegate<Customer>(CommandType.Text, cmdText,
new RowMapperDelegate<Customer>((reader, rowNum) =>
{
Customer customer = new Customer();
customer.Address = reader.GetString(0, string.Empty);
customer.City = reader.GetString(1, string.Empty);
customer.CompanyName = reader.GetString(2, string.Empty);
customer.ContactName = reader.GetString(3, string.Empty);
customer.ContactTitle = reader.GetString(4, string.Empty);
customer.Country = reader.GetString(5, string.Empty);
customer.Fax = reader.GetString(6, string.Empty);
customer.Id = reader.GetString(7, string.Empty);
customer.Phone = reader.GetString(8, string.Empty);
customer.PostalCode = reader.GetString(9, string.Empty);
customer.Region = reader.GetString(10, string.Empty);
return customer;
})).ToList();
この大幅に向上、パフォーマンス、おかげで多くの。 – Unrecognized