G'dayの人々。このようなサブリストに基づいてIGroupingを作成する
public class ObjectA
{
public string PropertyA { get; set; }
public List<string> ListProperty { get; set; }
}
とコレクションクラス:
public class CollectionB
{
public List<ObjectA> Collection { get; set; }
}
thusly使用されている。一つは作成しますどのように
public void MethodC(CollectionB coll)
{
coll.Add(new ObjectA
{
PropertyA = "merry"
ListProperty = new List<string> { "foo", "bar" }
});
coll.Add(new ObjectA
{
PropertyA = "xmas"
ListProperty = new List<string> { "yee", "har", "foo" }
});
coll.Add(new ObjectA
{
PropertyA = "folks"
ListProperty = new List<string> { "bar", "bah", "humbug" }
});
}
はちょうど私は、次のクラスを持っていたとしましょうCollectionBのIGrouping<string, ObjectA>
はObjectAのPropertyList
プロパティstキー("foo"
、"bar"
など)としてのリング?
グループに重複しても私を悩ましくはしません。
私はクエリ構文に対する選好持っているこれらのセットアップについて
あなたは知っています、今、本当のピエロの靴のように感じます。 私はクエリ構文の使用を考慮しませんでした。これは主に、それを使用する必要があっても約8年経っているためです。 今や明らかになったようです;) 乾杯してください。 – Ubermonk