开发者

How to map a Value Object in Entity Framework 4

开发者 https://www.devze.com 2023-02-09 03:49 出处:网络
I want map a value object in Entity Framework 4 as in NHiber开发者_JAVA百科nate where I use Component-Class (Nested in AR). How do I do this?There are two ways that I know of.The easiest is to use Com

I want map a value object in Entity Framework 4 as in NHiber开发者_JAVA百科nate where I use Component-Class (Nested in AR). How do I do this?


There are two ways that I know of. The easiest is to use ComplexType, which cannot have a key. The more difficult way is to use a POCO with all setters marked private (example) and with a key, which will allow you to persist it to a separate database table. (Or you can kinda mix to two and do the former with private setters, I suppose.)

0

精彩评论

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