我收到此错误,当我尝试一个新的对象添加到可能未设置导航集合导航属性。
这是我的POCO:
public class Category : BaseEntity,IDeletable
{
public Category()
{
Products = new List<Product>();
ChildCategories = new List<Category>();
}
[Required]
[Display(ResourceType = typeof(DelkaShop.Entities.EntityText.EntityText), Name = "EntityName")]
public String Name { get; set; }
[Display(ResourceType = typeof(DelkaShop.Entities.EntityText.EntityText), Name = "ParentCategory")]
public int? ParentCategoryId { get; set; }
[Display(ResourceType = typeof(DelkaShop.Entities.EntityText.EntityText), Name = "ItemsPerPage")]
public int? ItemsPerPage { get; set; }
[InverseProperty("Categories")]
public ICollection<Product> Products { get; set; }
[ForeignKey("ParentCategoryId")]
[Display(ResourceType = typeof(DelkaShop.Entities.EntityText.EntityText), Name = "ParentCategory")]
public Category ParentCategory { get; set; }
public ICollection<Category> ChildCategories { get; set; }
}
在微风中我做服用点像product.Categories.push(newCategoryObject);
有人能指出我到正确的方向?
编辑:我忘了提,我得到这个错误的多对多的关系,只是,这是不被支持的文档中读取。
是否有任何机会解决方法?