UPDATED DEPENDENCIES (also removed warning / uneeded code in startup.cs no longer required)

This commit is contained in:
2020-12-28 17:29:33 +00:00
parent 95631dbe74
commit d6856de91a
3 changed files with 42 additions and 28 deletions

View File

@@ -36,8 +36,8 @@ namespace AyaNova
_newLog = nlogLoggerProvider.CreateLogger("SERVER");
_hostingEnvironment = hostingEnvironment;
AyaNova.Util.ApplicationLogging.LoggerProvider = nlogLoggerProvider;
ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH = hostingEnvironment.ContentRootPath;
ServerBootConfig.SEEDING=false;
ServerBootConfig.AYANOVA_CONTENT_ROOT_PATH = hostingEnvironment.ContentRootPath;
ServerBootConfig.SEEDING = false;
}
private readonly ILogger _newLog;
@@ -159,17 +159,31 @@ namespace AyaNova
_newLog.LogDebug("EF Core");
services.AddEntityFrameworkNpgsql().AddDbContext<AyContext>(
options => options.UseNpgsql(_connectionString
//,opt => opt.EnableRetryOnFailure()//REMOVED THIS BECAUSE IT WAS INTEFERING WITH TRANSACTIONS BUT THEN DIDN'T USE THE TRANSACTION BUT IT SEEMS FASTER WITHOUT IT AS WELL SO...??
)//http://www.npgsql.org/efcore/misc.html?q=execution%20strategy#execution-strategy
.ConfigureWarnings(warnings => //https://livebook.manning.com/#!/book/entity-framework-core-in-action/chapter-12/v-10/85
warnings.Throw( //Throw an exception on client eval, not necessarily an error but a smell
// Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.QueryClientEvaluationWarning
))
.EnableSensitiveDataLogging(LOG_SENSITIVE_DATA)
);
//change to resolve error:
//2020-12-28 09:20:14.3545|WARN|Microsoft.EntityFrameworkCore.Infrastructure|'AddEntityFramework*' was called on the service provider, but 'UseInternalServiceProvider' wasn't called in the DbContext options configuration. Consider removing the 'AddEntityFramework*' call, as in most cases it's not needed and may cause conflicts with other products and services registered in the same service provider.
//https://stackoverflow.com/questions/62917136/addentityframework-was-called-on-the-service-provider-but-useinternalservic
// services.AddEntityFrameworkNpgsql().AddDbContext<AyContext>(
// options => options.UseNpgsql(_connectionString
// //,opt => opt.EnableRetryOnFailure()//REMOVED THIS BECAUSE IT WAS INTEFERING WITH TRANSACTIONS BUT THEN DIDN'T USE THE TRANSACTION BUT IT SEEMS FASTER WITHOUT IT AS WELL SO...??
// )//http://www.npgsql.org/efcore/misc.html?q=execution%20strategy#execution-strategy
// .ConfigureWarnings(warnings => //https://livebook.manning.com/#!/book/entity-framework-core-in-action/chapter-12/v-10/85
// warnings.Throw( //Throw an exception on client eval, not necessarily an error but a smell
// // Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.QueryClientEvaluationWarning
// ))
// .EnableSensitiveDataLogging(LOG_SENSITIVE_DATA)
// );
services.AddDbContext<AyContext>(
options => options.UseNpgsql(_connectionString
//,opt => opt.EnableRetryOnFailure()//REMOVED THIS BECAUSE IT WAS INTEFERING WITH TRANSACTIONS BUT THEN DIDN'T USE THE TRANSACTION BUT IT SEEMS FASTER WITHOUT IT AS WELL SO...??
)//http://www.npgsql.org/efcore/misc.html?q=execution%20strategy#execution-strategy
.ConfigureWarnings(warnings => //https://livebook.manning.com/#!/book/entity-framework-core-in-action/chapter-12/v-10/85
warnings.Throw( //Throw an exception on client eval, not necessarily an error but a smell
// Microsoft.EntityFrameworkCore.Diagnostics.RelationalEventId.QueryClientEvaluationWarning
))
.EnableSensitiveDataLogging(LOG_SENSITIVE_DATA)
);