开发者

How to map a Value Object in Entity Framework 4

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜