using DigitalData.Core.Abstractions.Infrastructure; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; namespace DigitalData.Core.Infrastructure; public static class DependencyInjection { public static IServiceCollection AddDbRepository(this IServiceCollection services, Func> queryFactory) where TDbContext : DbContext where TEntity : DbContext { return services .AddScoped, DbRepository>() .AddSingleton(queryFactory); } }