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

Override default repository through the ServiceCollection #16

Open
Psypher9 opened this issue Sep 16, 2022 · 2 comments
Open

Override default repository through the ServiceCollection #16

Psypher9 opened this issue Sep 16, 2022 · 2 comments
Milestone

Comments

@Psypher9
Copy link
Member

Psypher9 commented Sep 16, 2022

Premise: Type scanning automatically scans and registers any IRepository and IReadOnlyRepository with the DefaultRepository

  • I can extend the BasicRepos service collection to manually add a specific repository implementation for a given entity type

Example

builder.Services.AddBasicRepos()
                         .AddRepository<MyOverridingRepository>();
  • The AddRepository<TRepository>() extension only accepts types that implements IRepository and/or IReadOnlyRepository and registers a service for each of the implemented interfaces
@Psypher9 Psypher9 added this to the 4.0.0 milestone Sep 20, 2022
@rezalas
Copy link

rezalas commented Oct 1, 2022

Mind if I take a crack at this?

@Psypher9
Copy link
Member Author

Psypher9 commented Oct 1, 2022

Sure go for it!

@Psypher9 Psypher9 moved this to 📋 Backlog in Basic Repos Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants