製品()のリストがあり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ます。これは再帰的に可能ですか?