Custom repositories should override the default repositories
See original GitHub issueWe can create custom repositories easily. But even we create custom repository for a Person entitiy, we can still inject IRepository<Person>
. That’s very good. But think that we overrided Delete method on the custom repository and changed delete logic a bit. What happens if we still use IRepository<Person>
instead of custom IPersonRepository
? Delete method will work as before. So, there will be 2 different Delete method implementations for same entity. This is dangerous!
So, while registering default repositories, we can check if there is a custom implementation and register IRepository<TEntity>
as the custom repository.
Issue Analytics
- State:
- Created 8 years ago
- Comments:22 (11 by maintainers)
Top Results From Across the Web
When creating a yum repo in Red Hat Satellite 6, can it be ...
The custom product has many individual repositories already created under it. If a new repository is created, it is Enabled by default in...
Read more >Manage custom repositories - HCL Product Documentation
Use the RHEL Custom Repository Management dashboard to register and manage standard ... Disable custom repository support - Red Hat Enterprise Linux.
Read more >[SOLVED] Prevent yum to change the content of /etc/ ...
Dear All, In my /etc/yum.repos.d directory, the default .repo files (e.g. CentOS-Base.repo) are replaced by custom files pointing to a local ...
Read more >Setting repository visibility
Organization owners can restrict the ability to change repository visibility to organization owners only. For more information, see "Restricting repository ...
Read more >Declaring repositories
Repositories with custom URLs can be specified as Maven or Ivy repositories by calling the corresponding methods available on the RepositoryHandler API.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This can be done manually using Configuration.ReplaceService (http://www.aspnetboilerplate.com/Pages/Documents/Startup-Configuration#replacing-built-in-services) in module’s PreInitialize, as shown bloe:
I decided to not do it automatically, because we may have more than one dbcontext containing the same entity and we may have more than one custom repository implementation (for different dbcontextes) and ABP can not know which implementation to be used.
C# Generics: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/index