製品()のリストがありIList<Product>
、すべてのデータが事前に入力されています。
モデル:Product
public class Product
{
public int Id { get; set; }
public int ParentProductId { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public IList<Product> Children { get; set; }
}
プロパティChildren
はタイプIList<Product>
になります。つまり、ネストされているため、n
レベルまでの子を含めることができます。
私は別のモデルを持っていますFilterModel
。
モデル:FilterModel
public class FilterModel
{
//// This is same as that of Product Code
public string Code { get; set; }
//// This is a combination of Products Name, Id and some static strings
public string FilterUrl { get; set; }
public IList<FilterModel> Children
}
これも同じネストされた構造を持っています。
FilterModel
最初の()から2番目のモデル()にデータを挿入することを計画していProduct
ます。これは再帰的に可能ですか?