From d6856de91a5541850fec9a7282a1bc272675ca32 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 28 Dec 2020 17:29:33 +0000 Subject: [PATCH] UPDATED DEPENDENCIES (also removed warning / uneeded code in startup.cs no longer required) --- docs/8.0/ayanova/mkdocs.yml | 6 +++--- server/AyaNova/AyaNova.csproj | 26 ++++++++++++------------ server/AyaNova/Startup.cs | 38 ++++++++++++++++++++++++----------- 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/docs/8.0/ayanova/mkdocs.yml b/docs/8.0/ayanova/mkdocs.yml index 01a6c980..49a14913 100644 --- a/docs/8.0/ayanova/mkdocs.yml +++ b/docs/8.0/ayanova/mkdocs.yml @@ -43,8 +43,8 @@ nav: - 'Notification subscriptions': 'form-home-notify-subscriptions.md' - 'Notifications list': 'form-home-notifications.md' - Customers: - - 'Customers': 'form-cust-customers.md' - - 'Head offices': 'form-cust-head-offices.md' + - 'Customers': 'form-customers.md' + - 'Head offices': 'form-head-offices.md' - Service: - 'Schedule': 'form-svc-schedule.md' - 'Workorders': 'form-svc-workorders.md' @@ -93,7 +93,7 @@ nav: - Customer: - 'Workorders': 'form-customer-workorders.md' - 'Customer service requests': 'form-customer-csr-list.md' - - 'Widget (testing)': 'form-widget.md' + - 'Widgets (testing)': 'form-widgets.md' - Features: - 'Translation': 'ay-translation.md' - 'Notification': 'ay-notification.md' diff --git a/server/AyaNova/AyaNova.csproj b/server/AyaNova/AyaNova.csproj index 065a149d..b3b35cbf 100644 --- a/server/AyaNova/AyaNova.csproj +++ b/server/AyaNova/AyaNova.csproj @@ -15,28 +15,28 @@ - + - + - - - - + + + + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + - - - + + + - + diff --git a/server/AyaNova/Startup.cs b/server/AyaNova/Startup.cs index 3b172c7a..afb8ca54 100644 --- a/server/AyaNova/Startup.cs +++ b/server/AyaNova/Startup.cs @@ -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( - 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( + // 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( + 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) + );