EF6模型类构造函数的问题?

时间:2015-06-17 18:59:52

标签: c# entity-framework entity-framework-6

E.g。

public class Product
{
    protected Product()
    {
        // This is required for EF
    }

    public Product(String name)
    {
        Name = name;
    }

    public String Name { get; set; }
}

似乎这可能是problem而EF没有获得默认构造函数,所以我们给它一个受保护的参数 - 一个来解决它。但是,我想知道是否还有其他问题需要注意?

0 个答案:

没有答案