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

Entity Collection #185

Open
Corniel opened this issue Sep 15, 2021 · 0 comments
Open

Entity Collection #185

Corniel opened this issue Sep 15, 2021 · 0 comments

Comments

@Corniel
Copy link
Collaborator

Corniel commented Sep 15, 2021

When dealing with Domain-Driven Design, the default set of collections offered by .NET are not sufficient. It would be nice to have a generic reusable collection of Entities that offers the functionality needed.

So what is needed? Let's summarize what I think is needed:

  1. Implements IReadOnlyList<TEntity>.
  2. Defined order of its elements.
  3. Guaranteed uniqueness of elements based on their ID.
  4. Possibility to get elements by their ID.
  5. Add(TEntity entity) that throws when the enetity is null or the ID allready exists.
  6. AddOrUpdate(Tentity entity) that updates the entity (on the same spot) or adds it at the end, if new.
  7. Sort the collection, optional with a custom comparer
  8. Clear the collection
  9. Access to read-only collection of the identifiers

Any toughts? And should it be part of Qowaiv, or Qowaiv.DomainModel? (or a new package, although I would not prefer that?)

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

1 participant