Exemple #1
0
 public static IServiceCollection AddRepositoryDefinition <TContext>(this IServiceCollection services, Type repoType)
     where TContext : DbContext
 {
     services.TryAddSingleton(typeof(IRepository <>), repoType);
     services.AddDbContextPool <TContext>(DefaultConfig.ConfigureDbContextOptionsBuilder("coworker-db", repoType.Assembly.GetName().Name));
     return(services);
 }
 public static void ConfigDefault(Action <Action <IServiceProvider, DbContextOptionsBuilder> > callback)
 => callback(DefaultConfig.ConfigureDbContextOptionsBuilder("coworker-db", typeof(ServiceCollectionExtensions).Assembly.GetName().Name));