You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// what's the best way to support custom reposity?
if (hasCustomRepository)
{
var customRepo = _context.GetService<IRepository<TEntity>>();
if (customRepo != null)
{
return customRepo;
}
}
But mabe to check it automatic like TryGetService on HasCustom Check?
Check if Custom is in _context.GetService
If yes - return it.
If no - return new default.
Because user can dont know is there custom or not. He just want to get Repository Service.
The text was updated successfully, but these errors were encountered:
Mabe to make it true as default?
Or rename to forceGetDefault = false.
Or mabe to make 2 functions.
If I register MyCustomRepository I want to use it in most cases. Every time call GetRepositor with additional parameters for my opinion is unclear and more big code.
In the previous version, the code var customRepo = _context.GetService<IRepository<TEntity>>(); will throw exception if no custom repository. If the new version return null rather than throw exception, I think remove the parameter is good idea
Now code.
But mabe to check it automatic like TryGetService on HasCustom Check?
Because user can dont know is there custom or not. He just want to get Repository Service.
The text was updated successfully, but these errors were encountered: