1.Product类
public class Product
{
Public Product()
{
this.Name=””;
this.Category = new Category();
}
public string ID{get; set;}
public string Name{get; set;}
public virtual Category Category{get; set;}
}
2.Category类
public class Category
{
public Category()
{
this.Name = “”;
this.Products = new List<Product>();
}