private static void AddCoreDbContext(IServiceCollection services, DataBaseSettingsModel dbSettingsModel) { services.AddDbContext <AsPRoTasksContext>(options => options.UseSqlServer(dbSettingsModel.AsPRoTasksCore)); services.AddScoped <IAsPRoTasksContext>(provider => provider.GetService <AsPRoTasksContext>()); }
public static IServiceCollection AddDatabase(this IServiceCollection services, DataBaseSettingsModel dbSettingsModel, IHostingEnvironment environment) { AddCoreDbContext(services, dbSettingsModel); return(services); }