Value cannot be null. Parameter name: entitySet

前端 未结 12 1843
夕颜
夕颜 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条回答
  •  爱一瞬间的悲伤
    2020-12-03 17:26

    Late to the game...but if it helps...

    I had this same problem, everything was working fine, but this issue appeared, I added the following to one of my classes

    public HttpPostedFileBase File { get; set; }
    

    which seemed to break it.

    I ensured I didn't map this to the database by using the following:

    [NotMapped]
    public HttpPostedFileBase File { get; set; }
    

    You need to add the following using statement:

    using System.ComponentModel.DataAnnotations.Schema;
    

    Hope this helps

提交回复
热议问题