diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 9cbc43a..854a50a 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "dotnet-ef": { - "version": "7.0.0", + "version": "7.0.2", "commands": [ "dotnet-ef" ] diff --git a/.editorconfig b/.editorconfig index c0d30c2..26ca1c3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,9 @@ roslynator_object_creation_type_style = implicit_when_type_is_obvious # CA5395: Action method xyz needs to specify the HTTP request kind explicitly dotnet_diagnostic.CA5395.severity = suggestion +# CA1852: Type can be sealed because it has no subtypes in its containing assembly and is not externally visible +dotnet_diagnostic.CA1852.severity = suggestion + # CA5391: Method Index handles a HttpPost request without performing antiforgery token validation. You also need to ensure that your HTML form sends an antiforgery token. dotnet_diagnostic.CA5391.severity = suggestion diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d084b7..42791c4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,6 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 7.0.100 + dotnet-version: 7.0.102 - name: Build DNTIdentity run: dotnet build ./src/ASPNETCoreIdentitySample/ASPNETCoreIdentitySample.csproj --configuration Release \ No newline at end of file diff --git a/Directory.Packages.props b/Directory.Packages.props index 4dd3b79..c3e87d4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,39 +1,39 @@ - - - + + + - + - - - - + + + + - - + + - - - - - - + + + + + + - + - - - + + + - - - - + + + + diff --git a/README.md b/README.md index b6393b6..b0b7b61 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ 
-# سفارشی سازی ASP.NET Core Identity SDK-7.0.100 +# سفارشی سازی ASP.NET Core Identity SDK-7.0.102

diff --git a/global.json b/global.json index 4656040..c13b8b0 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.100", + "version": "7.0.102", "rollForward": "latestMajor", "allowPrerelease": true } diff --git a/src/ASPNETCoreIdentitySample.DataLayer.MSSQL/_01-add_migrations.cmd b/src/ASPNETCoreIdentitySample.DataLayer.MSSQL/_01-add_migrations.cmd index 7d16e87..8e4109c 100644 --- a/src/ASPNETCoreIdentitySample.DataLayer.MSSQL/_01-add_migrations.cmd +++ b/src/ASPNETCoreIdentitySample.DataLayer.MSSQL/_01-add_migrations.cmd @@ -1,6 +1,7 @@ For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c_%%a_%%b) For /f "tokens=1-2 delims=/:" %%a in ("%TIME: =0%") do (set mytime=%%a%%b) -dotnet tool update --global dotnet-ef --version 7.0.0 +dotnet tool update --global dotnet-ef --version 7.0.2 +dotnet tool restore dotnet build dotnet ef migrations --startup-project ../ASPNETCoreIdentitySample/ add V%mydate%_%mytime% --context MsSqlDbContext pause \ No newline at end of file diff --git a/src/ASPNETCoreIdentitySample.DataLayer.MSSQL/_02-update_db.cmd b/src/ASPNETCoreIdentitySample.DataLayer.MSSQL/_02-update_db.cmd index bb67068..19a9ff6 100644 --- a/src/ASPNETCoreIdentitySample.DataLayer.MSSQL/_02-update_db.cmd +++ b/src/ASPNETCoreIdentitySample.DataLayer.MSSQL/_02-update_db.cmd @@ -1,4 +1,5 @@ -dotnet tool update --global dotnet-ef --version 7.0.0 +dotnet tool update --global dotnet-ef --version 7.0.2 +dotnet tool restore dotnet build dotnet ef --startup-project ../ASPNETCoreIdentitySample/ database update --context MsSqlDbContext pause \ No newline at end of file diff --git a/src/ASPNETCoreIdentitySample.DataLayer.SQLite/_01-add_migrations.cmd b/src/ASPNETCoreIdentitySample.DataLayer.SQLite/_01-add_migrations.cmd index d8184e9..56524ce 100644 --- a/src/ASPNETCoreIdentitySample.DataLayer.SQLite/_01-add_migrations.cmd +++ b/src/ASPNETCoreIdentitySample.DataLayer.SQLite/_01-add_migrations.cmd @@ -1,6 +1,7 @@ For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c_%%a_%%b) For /f "tokens=1-2 delims=/:" %%a in ("%TIME: =0%") do (set mytime=%%a%%b) -dotnet tool update --global dotnet-ef --version 7.0.0 +dotnet tool update --global dotnet-ef --version 7.0.2 +dotnet tool restore dotnet build dotnet ef migrations --startup-project ../ASPNETCoreIdentitySample/ add V%mydate%_%mytime% --context SQLiteDbContext pause \ No newline at end of file diff --git a/src/ASPNETCoreIdentitySample.DataLayer.SQLite/_02-update_db.cmd b/src/ASPNETCoreIdentitySample.DataLayer.SQLite/_02-update_db.cmd index a58c470..880e02b 100644 --- a/src/ASPNETCoreIdentitySample.DataLayer.SQLite/_02-update_db.cmd +++ b/src/ASPNETCoreIdentitySample.DataLayer.SQLite/_02-update_db.cmd @@ -1,4 +1,5 @@ -dotnet tool update --global dotnet-ef --version 7.0.0 +dotnet tool update --global dotnet-ef --version 7.0.2 +dotnet tool restore dotnet build dotnet ef --startup-project ../ASPNETCoreIdentitySample/ database update --context SQLiteDbContext pause \ No newline at end of file diff --git a/src/ASPNETCoreIdentitySample.Services/Identity/Logger/DbLogger.cs b/src/ASPNETCoreIdentitySample.Services/Identity/Logger/DbLogger.cs index 8518d09..5d80ffe 100644 --- a/src/ASPNETCoreIdentitySample.Services/Identity/Logger/DbLogger.cs +++ b/src/ASPNETCoreIdentitySample.Services/Identity/Logger/DbLogger.cs @@ -28,15 +28,9 @@ public DbLogger( _loggerProvider = loggerProvider ?? throw new ArgumentNullException(nameof(loggerProvider)); } - public IDisposable BeginScope(TState state) - { - return new NoopDisposable(); - } + public IDisposable BeginScope(TState state) => new NoopDisposable(); - public bool IsEnabled(LogLevel logLevel) - { - return logLevel >= _minLevel; - } + public bool IsEnabled(LogLevel logLevel) => logLevel >= _minLevel; public void Log( LogLevel logLevel, @@ -69,15 +63,15 @@ public void Log( var httpContextAccessor = _serviceProvider.GetService(); var appLogItem = new AppLogItem - { - Url = httpContextAccessor?.HttpContext != null - ? httpContextAccessor.HttpContext.Request.Path.ToString() - : string.Empty, - EventId = eventId.Id, - LogLevel = logLevel.ToString(), - Logger = _loggerName, - Message = message - }; + { + Url = httpContextAccessor?.HttpContext != null + ? httpContextAccessor.HttpContext.Request.Path.ToString() + : string.Empty, + EventId = eventId.Id, + LogLevel = logLevel.ToString(), + Logger = _loggerName, + Message = message, + }; var props = httpContextAccessor?.GetShadowProperties(); SetStateJson(state, appLogItem); _loggerProvider.AddLogItem(new LoggerItem { Props = props, AppLogItem = appLogItem }); @@ -88,12 +82,13 @@ private static void SetStateJson(TState state, AppLogItem appLogItem) try { appLogItem.StateJson = JsonSerializer.Serialize( - state, - new JsonSerializerOptions - { - DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, - WriteIndented = true - }); + state, + new JsonSerializerOptions + { + DefaultIgnoreCondition = + JsonIgnoreCondition.WhenWritingNull, + WriteIndented = true, + }); } catch { @@ -101,7 +96,7 @@ private static void SetStateJson(TState state, AppLogItem appLogItem) } } - private class NoopDisposable : IDisposable + private sealed class NoopDisposable : IDisposable { public void Dispose() { @@ -109,8 +104,9 @@ public void Dispose() GC.SuppressFinalize(this); } - protected virtual void Dispose(bool disposing) + private static void Dispose(bool disposing) { + // empty on purpose } } } \ No newline at end of file diff --git a/src/ASPNETCoreIdentitySample/appsettings.json b/src/ASPNETCoreIdentitySample/appsettings.json index 00337d2..c4d2b56 100644 --- a/src/ASPNETCoreIdentitySample/appsettings.json +++ b/src/ASPNETCoreIdentitySample/appsettings.json @@ -9,9 +9,9 @@ "IncludeScopes": false, "LogLevel": { "Default": "Warning", - "System": "Information", - "Microsoft": "Information", - "Microsoft.Hosting.Lifetime": "Information" + "System": "Warning", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Warning" } }, "webOptimizer": { @@ -47,7 +47,7 @@ }, "ConnectionStrings": { "SqlServer": { - "ApplicationDbContextConnection": "Data Source=(local);Initial Catalog=TestASPNETCore70100IdentityDb;Integrated Security=true" + "ApplicationDbContextConnection": "Data Source=(local);Initial Catalog=TestASPNETCore70100IdentityDb;Integrated Security=true;Encrypt=False;" }, "LocalDb": { "InitialCatalog": "TestASPNETCore70100IdentityDb",