产品
ID 类别ID 名称...
类别 ID ParentCategoryID 名称
产品 > CategoryID = 外键
public class NameIDCount
{
public int ID {get;set;}
public string Name { get;set;}
public int Count { get;set;}
}
public class NameIDCountList
{
public NameIDCount _Category { get; set; }
public List<NameIDCount> _SubCategories { get; set; }
}
怎么做
Linq 查询?
List<NameIDCountList> NameIDCountList =
林克?
结果:
<a href="/category/id=1">PC [23]</a>
<a href="/category/id=4">NoteBook [2]</a>
<a href="/category/id=5">Desktop [21]</a>
<a href="/category/id=2">Monitor [6]</a>
<a href="/category/id=8">LED Monitor [4]</a>
<a href="/category/id=9">LCD Monitor [2]</a>