Skip to content
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

Closed
SuperJMN opened this issue Oct 13, 2014 · 3 comments
Closed

ICollection for related entities is too permissive. #857

SuperJMN opened this issue Oct 13, 2014 · 3 comments

Comments

@SuperJMN
Copy link

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.

@rowanmiller
Copy link
Contributor

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.

@rowanmiller rowanmiller added this to the Backlog milestone Oct 22, 2014
@rowanmiller
Copy link
Contributor

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.

@ajcvickers
Copy link
Contributor

Dupe of #752

@bricelam bricelam removed this from the Backlog milestone Jan 2, 2018
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants