0

I want map a value object in Entity Framework 4 as in NHibernate where I use Component-Class (Nested in AR). How do I do this?

1 Answer 1

2

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.)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.