2
我在EF6中遇到了一个非常奇怪的行为。我有插入失败的实体,但是当我列举的实体,在第一时间之后,我检索由实体框架电动工具实体框架返回数据库中不存在的实体
public partial class Category
{
public Category()
{
this.Products = new List<Product>();
this.TranslationCategories = new List<TranslationCategory>();
}
public int CategoryId { get; set; }
public Nullable<int> ParentCategoryId { get; set; }
public string Reference { get; set; }
public System.DateTime CreationDate { get; set; }
public string Name { get; set; }
public Nullable<bool> Published { get; set; }
public string Artwork { get; set; }
public string TypeCode { get; set; }
public virtual ICollection<Product> Products { get; set; }
public virtual ICollection<TranslationCategory> TranslationCategories {get;set; }
}
可以显示类别和db类的代码吗? –
如果使用'SaveChanges'而不是'SaveChangesAsync',该怎么办? – Hopeless
@Hopless已经尝试过了,同样奇怪的行为。 – BobyOneKenobi