Skip to content

Commit

Permalink
Update dependencies, Close #60
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Feb 3, 2023
1 parent b6af781 commit 41a9718
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"dotnet-ef": {
"version": "7.0.0",
"version": "7.0.2",
"commands": [
"dotnet-ef"
]
Expand Down
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
48 changes: 24 additions & 24 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
<Project>
<ItemGroup>
<PackageVersion Include="Meziantou.Analyzer" Version="1.0.746" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.4.27" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.3" />
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.14" />
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.5.22" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
<PackageVersion Include="AsyncFixer" Version="1.6.0" />
<PackageVersion Include="Asyncify" Version="0.9.7" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="8.48.0.56517" />
<PackageVersion Include="SonarAnalyzer.CSharp" Version="8.52.0.60960" />
<PackageVersion Include="SecurityCodeScan.VS2019" Version="5.6.7" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.1.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.2.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="7.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.2" />
<PackageVersion Include="DNTBreadCrumb.Core" Version="1.9.3" />
<PackageVersion Include="DNTCaptcha.Core" Version="4.3.3" />
<PackageVersion Include="DNTCommon.Web.Core" Version="3.4.0" />
<PackageVersion Include="DNTCaptcha.Core" Version="4.4.2" />
<PackageVersion Include="DNTCommon.Web.Core" Version="3.5.0" />
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
<PackageVersion Include="DNTPersianUtils.Core" Version="5.4.5" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
<PackageVersion Include="DNTPersianUtils.Core" Version="5.4.9" />
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="7.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.2" />
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.2" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.2" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="7.0.2" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="7.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageVersion Include="MSTest.TestFramework" Version="3.0.2" />
<PackageVersion Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.2" />
<PackageVersion Include="cloudscribe.Web.Pagination" Version="6.0.0" />
<PackageVersion Include="LigerShark.WebOptimizer.Core" Version="3.0.372" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div dir="rtl">

# سفارشی سازی ASP.NET Core Identity SDK-7.0.100
# سفارشی سازی ASP.NET Core Identity SDK-7.0.102

<p>
<a href="https://github.com/VahidN/DNTIdentity">
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "7.0.102",
"rollForward": "latestMajor",
"allowPrerelease": true
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
46 changes: 21 additions & 25 deletions src/ASPNETCoreIdentitySample.Services/Identity/Logger/DbLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,9 @@ public DbLogger(
_loggerProvider = loggerProvider ?? throw new ArgumentNullException(nameof(loggerProvider));
}

public IDisposable BeginScope<TState>(TState state)
{
return new NoopDisposable();
}
public IDisposable BeginScope<TState>(TState state) => new NoopDisposable();

public bool IsEnabled(LogLevel logLevel)
{
return logLevel >= _minLevel;
}
public bool IsEnabled(LogLevel logLevel) => logLevel >= _minLevel;

public void Log<TState>(
LogLevel logLevel,
Expand Down Expand Up @@ -69,15 +63,15 @@ public void Log<TState>(

var httpContextAccessor = _serviceProvider.GetService<IHttpContextAccessor>();
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 });
Expand All @@ -88,29 +82,31 @@ private static void SetStateJson<TState>(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
{
// don't throw exceptions from logger
}
}

private class NoopDisposable : IDisposable
private sealed class NoopDisposable : IDisposable
{
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}

protected virtual void Dispose(bool disposing)
private static void Dispose(bool disposing)
{
// empty on purpose
}
}
}
8 changes: 4 additions & 4 deletions src/ASPNETCoreIdentitySample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 41a9718

Please sign in to comment.