Value cannot be null. Parameter name: entitySet

前端 未结 12 1865
夕颜
夕颜 2020-12-03 17:02

I have a fairly standard setup with simply POCO classes

public class Project
{

    public int ProjectId { get; set; }
    public string Name { get; set; }
          


        
12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 17:25

    I have some properties in "ExpenseModel", one of this was...

    public virtual Type TypeId {get; set;}
    

    which was causes the above same error because of "Type" propertyType, so I changed
    "Type" => "ExpenseType" and it worked... :-)

    public virtual ExpenseType TypeId {get; set;}
    

    ExpenseModel.cs

    public class ExpenseTypes
    {
        [Key]
        public int Id { get; set; }
        public string TypeName { get; set; }
        public string Description { get; set; }
    }
    

提交回复
热议问题