feat: add IServiceProvider extension to resolve IRepository<TEntity>
This commit is contained in:
parent
10ff9b9745
commit
daa3f4d5be
@ -0,0 +1,15 @@
|
|||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using System;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace DigitalData.Core.Abstraction.Application.Repository
|
||||||
|
{
|
||||||
|
public static class ServiceProviderExtensions
|
||||||
|
{
|
||||||
|
public static IRepository<TEntity> Repository<TEntity>(this IServiceProvider serviceProvider)
|
||||||
|
{
|
||||||
|
return serviceProvider.GetRequiredService<IRepository<TEntity>>();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user