forked from ddrilling/AsbCloudServer
при конфигурации отладки используется строка подключения к pg с более подробными ошибками.
This commit is contained in:
parent
8a7e2872ee
commit
90026f95d3
@ -82,8 +82,12 @@ namespace AsbCloudInfrastructure
|
|||||||
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
|
public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration)
|
||||||
{
|
{
|
||||||
MapsterSetup();
|
MapsterSetup();
|
||||||
|
var connectionStringName = "DefaultConnection";
|
||||||
|
#if DEBUG
|
||||||
|
connectionStringName = "DebugConnection";
|
||||||
|
#endif
|
||||||
services.AddDbContext<AsbCloudDbContext>(options =>
|
services.AddDbContext<AsbCloudDbContext>(options =>
|
||||||
options.UseNpgsql(configuration.GetConnectionString("DefaultConnection")));
|
options.UseNpgsql(configuration.GetConnectionString(connectionStringName)));
|
||||||
|
|
||||||
services.AddFluentValidation();
|
services.AddFluentValidation();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user