Value cannot be null. Parameter name: entitySet

前端 未结 12 1836
夕颜
夕颜 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:39

    In my case I had to reference another model class called IanaTimeZone, but instead of

    public virtual IanaTimeZone Timezone { get; set; }
    

    out of rush I typed this:

    public virtual TimeZone Timezone { get; set; }
    

    and it compiled fine because VS thought it was System.TimeZone but EF6 was throwing the error. Stupid thing but took me a while to figure out, so maybe this will help someone.

提交回复
热议问题