mirror of https://github.com/abpframework/abp.git
9 changed files with 52 additions and 49 deletions
@ -0,0 +1,26 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.Extensions.Configuration; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Volo.Abp.Data; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace AbpDesk.EntityFrameworkCore |
||||
|
{ |
||||
|
public static class AbpDeskDbConfigurer |
||||
|
{ |
||||
|
public static void Configure(IServiceCollection services, IConfigurationRoot configuration) |
||||
|
{ |
||||
|
//Configure DbConnectionOptions by configuration file (appsettings.json)
|
||||
|
services.Configure<DbConnectionOptions>(configuration); |
||||
|
|
||||
|
services.Configure<AbpDbContextOptions>(options => |
||||
|
{ |
||||
|
//Configures all dbcontextes to use Sql Server with calculated connection string
|
||||
|
options.Configure(context => |
||||
|
{ |
||||
|
context.DbContextOptions.UseSqlServer(context.ConnectionString); |
||||
|
}); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue