-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICollection for related entities is too permissive. #857
Comments
This is a part of the work we want to complete for #240. Leaving this issue open as we may not complete this part of the work in the initial RTM of EF7. |
BTW we should add that a reliance on ICollection is not baked into the EF7 code base, we have a small component at the moment that knows how to handle ICollection but the plan is to supplement this with the ability to provide code that configures how to add/remove items. |
Dupe of #752 |
It's a pity that we cannot have entities with read-only collections. It's a must for any Domain-Driven Design approach in order to enforce rules and restrictions. In a rich model (not anemic), entities are usually responsible for keeping relationships consistent with the model.
Forcing the usage of writeable collections makes it easy to violate those rules and restrictions of the domain. Please, improve it.
At least, we need a way to make Entity Framework work behind the stage to fill and navigate relations like it already does, but also provide means to avoid every collection to have methods like Add, Delete or Insert.
The text was updated successfully, but these errors were encountered: