EF Code First CTP5 - Using the name of the property as column name for foreign key

后端 未结 2 745
渐次进展
渐次进展 2021-01-06 08:12

Given the following model:

public class Foo
{
    public int Id { get; set;}
    public Bar TheBar { get; set; }
}

public class Bar
{
    public int Id { ge         


        
2条回答
  •  盖世英雄少女心
    2021-01-06 08:59

    The error was caused by a bug in CTP5. If the Id property was defined in a base class (which is not shown in the code above because I didn't think it was related), it breaks.

    I solved it by defining a base interface, but keeping the Id in each class.

提交回复
热议问题