开发者

How does Entity Framework 4.0 determine which parameters are required for the factory method of an entity?

开发者 https://www.devze.com 2022-12-25 07:30 出处:网络
I am 开发者_如何学Goworking with Entity Framework 4.0 (VS 2010 Beta 2, NOT RC).I can model the EDM and produce the required database.When I ask VS to generate the code for the model, it generates the

I am 开发者_如何学Goworking with Entity Framework 4.0 (VS 2010 Beta 2, NOT RC). I can model the EDM and produce the required database. When I ask VS to generate the code for the model, it generates the expected .designer.cs file. When I look at the factory methods for each entity that the designer has generated, I've noticed that it doesn't include all of the properties of the entity.

Is it correct to say that the factory method only includes properties that cannot be null ? This appears to be the case, but I'm not entirely sure.

Thanks,

Scott


That's exactly the case, all non-nullable properties are parameters for the factory method. All nullable properties are not


You can pass 0 as the primary key parameter

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号