次のようなList< Dictionary < string, object >>
変数があります。
private static List<Dictionary<string, object>> testData = new List<Dictionary<string, object>>(100);
// Just Sample data for understanding.
for (int i = 0; i < 100; i++)
{
var test = new Dictionary<string, object>
{
{ "aaa", "aaa" + i % 4 },
{ "bbb", "bbb" + i % 4 },
{ "ccc", "ccc" + i % 4 },
{ "ddd", "ddd" + i % 4 },
{ "eee", "eee" + i % 4 },
{ "fff", "fff" + i % 4 },
{ "ggg", "ggg" + i % 4 },
{ "hhh", "hhh" + i % 4 },
{ "iii", "iii" + i % 4 }
};
testData.Add(test);
}
ディクショナリでキー、値のリストを検索し、List< Dictionary < string, object >>
渡した searchPattern を含むものを返したいと思います。
Dictionary<string, object> searchPattern = new Dictionary<string, object>();
searchPattern .Add("aaa", "aaa4");
searchPattern .Add("eee", "eee2");
searchPattern .Add("fff", "fff1");
searchPattern .Add("ddd", "ddd3");
public List<Dictionary<string, object>> SearchList(List<Dictionary<string, object>> testData, Dictionary<string, object> searchPattern)
{
List<Dictionary<string, object>> result;
// Search the list.
return result;
}
検索するための他の提案も高く評価されています。どうもありがとう!!