using ModelConfiguration in Entity Framework gives an error “ is not a valid property expression ”

后端 未结 1 812
野趣味
野趣味 2021-01-27 19:23

In my C# project, I get an error when EF attempts to create my database The error occurs when I call

Database.SetInitializer(new CreateDatabaseIfNotExists

        
1条回答
  •  滥情空心
    2021-01-27 20:21

    Quite literally, the problem is what is described. Dependancies is a field, not a property. Just define it as:

    public virtual ICollection Dependancies
    {
         get;
         set;
    }
    

    And it should solve your problem.

    0 讨论(0)
提交回复
热议问题