【发布时间】:2013-02-17 04:37:43
【问题描述】:
当我尝试向导航添加新对象时收到此错误 不能设置集合导航属性。
这是我的 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);
有人能指出我正确的方向吗?
编辑: 我忘了提到我在多对多关系中遇到了这个错误,只是在文档中读到这还不支持。
是否有任何解决方法?
【问题讨论】:
标签: breeze