こんにちはすべて私は奇妙な最適化の質問があります、これは私が簡単にするためにいくつかの名前を変更したコードです
CollectionObject mycollobj = new CollectionObject();
List<string> MyProducts = new List<string>();
//get collection of selected customers that were passed in
var chckedValues = form.GetValues("assignChkBx");
foreach(string customer in chckedValues )
{
MyProducts.Clear();
//MyProducts is then set to a data access method in my data access class
MyProducts = DataLayerClass.GetProductsFromCustomer(customer);
foreach(string product in MyProducts)
{
string item1 = DataLayerClass.GetItem1(product);
string item2 = DataLayerClass.GetItem2(product);
mycollobj.loaditems(item1, item2);
}
}
基本的に、mycollobjは、かなり複雑な分析(私が制御できない)に使用されるブラックボックスです。このネストされたアルゴリズムを実行するためのより良い方法はありますか?どんな提案も大切にされており、何か説明が必要かどうか尋ねてください。ありがとう!