Skip to content

ICollection for related entities is too permissive. #857

Closed as duplicate

Description

@SuperJMN

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.

Activity

  1. rowanmiller commented on Oct 22, 2014

    @rowanmiller
    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.

  2. added this to the Backlog milestone on Oct 22, 2014
  3. rowanmiller commented on Oct 22, 2014

    @rowanmiller
    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.

  4. ajcvickers commented on Jul 8, 2016

    @ajcvickers
    Contributor

    Dupe of #752

  5. removed this from the Backlog milestone on Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions