Skip to content

Commit 0ecc36c

Browse files
authored
Merge pull request #62 from aminmesbahi/master
Updateted to .NET 8.0, NuGet Packages updated
2 parents ee3b758 + 1390803 commit 0ecc36c

File tree

18 files changed

+87
-61
lines changed

18 files changed

+87
-61
lines changed

Directory.Packages.props

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
<Project>
22
<ItemGroup>
3-
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.82" />
4-
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.7.30" />
3+
<PackageVersion Include="Meziantou.Analyzer" Version="2.0.145" />
4+
<PackageVersion Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.9.28" />
55
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="3.3.4" />
66
<PackageVersion Include="AsyncFixer" Version="1.6.0" />
77
<PackageVersion Include="Asyncify" Version="0.9.7" />
8-
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.8.0.76515" />
8+
<PackageVersion Include="SonarAnalyzer.CSharp" Version="9.20.0.85982" />
99
<PackageVersion Include="SecurityCodeScan.VS2019" Version="5.6.7" />
10-
<PackageVersion Include="Roslynator.Analyzers" Version="4.5.0" />
11-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="7.0.8" />
12-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.8" />
13-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.8" />
10+
<PackageVersion Include="Roslynator.Analyzers" Version="4.11.0" />
11+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Analyzers" Version="8.0.2" />
12+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.2" />
13+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.2" />
1414
<PackageVersion Include="DNTBreadCrumb.Core" Version="2.0.2" />
15-
<PackageVersion Include="DNTCaptcha.Core" Version="4.8.1" />
16-
<PackageVersion Include="DNTCommon.Web.Core" Version="3.5.3" />
17-
<PackageVersion Include="System.Drawing.Common" Version="7.0.0" />
18-
<PackageVersion Include="DNTPersianUtils.Core" Version="5.7.1" />
19-
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="7.0.8" />
20-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.8" />
21-
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.8" />
22-
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.8" />
23-
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.8" />
24-
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
25-
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
26-
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="7.0.4" />
27-
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
28-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.8" />
29-
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.8" />
15+
<PackageVersion Include="DNTCaptcha.Core" Version="5.0.0" />
16+
<PackageVersion Include="DNTCommon.Web.Core" Version="3.9.0" />
17+
<PackageVersion Include="System.Drawing.Common" Version="8.0.2" />
18+
<PackageVersion Include="DNTPersianUtils.Core" Version="5.9.0" />
19+
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.2" />
20+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Relational" Version="8.0.2" />
21+
<PackageVersion Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.2" />
22+
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.2" />
23+
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.2" />
24+
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
25+
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
26+
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
27+
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
28+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.2" />
29+
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="8.0.2" />
3030
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="7.0.8" />
3131
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
32-
<PackageVersion Include="Microsoft.Extensions.Options" Version="7.0.1" />
33-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
34-
<PackageVersion Include="MSTest.TestAdapter" Version="3.1.1" />
35-
<PackageVersion Include="MSTest.TestFramework" Version="3.1.1" />
36-
<PackageVersion Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.8" />
32+
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.2" />
33+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
34+
<PackageVersion Include="MSTest.TestAdapter" Version="3.2.2" />
35+
<PackageVersion Include="MSTest.TestFramework" Version="3.2.2" />
36+
<PackageVersion Include="Microsoft.Extensions.Caching.SqlServer" Version="8.0.2" />
3737
<PackageVersion Include="cloudscribe.Web.Pagination" Version="6.0.0" />
38-
<PackageVersion Include="LigerShark.WebOptimizer.Core" Version="3.0.386" />
38+
<PackageVersion Include="LigerShark.WebOptimizer.Core" Version="3.0.405" />
3939
<PackageVersion Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
4040
</ItemGroup>
4141
</Project>

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "7.0.306",
3+
"version": "8.0",
44
"rollForward": "latestMajor",
55
"allowPrerelease": false
66
}

src/ASPNETCoreIdentitySample.Common/ASPNETCoreIdentitySample.Common.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<FrameworkReference Include="Microsoft.AspNetCore.App" />

src/ASPNETCoreIdentitySample.Common/WebToolkit/ServerInfo.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
namespace ASPNETCoreIdentitySample.Common.WebToolkit;
1+
namespace ASPNETCoreIdentitySample.Common.WebToolkit;
22

33
public static class ServerInfo
44
{
5+
private static readonly string[] BinSplitArray = new[] { "bin" };
56
public static string GetAppDataFolderPath()
67
{
78
var appDataFolderPath = Path.Combine(GetWwwRootPath(), "App_Data");
@@ -16,7 +17,7 @@ public static string GetAppDataFolderPath()
1617
public static string GetWwwRootPath()
1718
{
1819
return Path.Combine(
19-
AppContext.BaseDirectory.Split(new[] { "bin" }, StringSplitOptions.RemoveEmptyEntries)[0],
20-
"wwwroot");
20+
AppContext.BaseDirectory.Split(BinSplitArray, StringSplitOptions.RemoveEmptyEntries)[0],
21+
"wwwroot");
2122
}
22-
}
23+
}

src/ASPNETCoreIdentitySample.DataLayer.InMemoryDatabase/ASPNETCoreIdentitySample.DataLayer.InMemoryDatabase.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\ASPNETCoreIdentitySample.DataLayer\ASPNETCoreIdentitySample.DataLayer.csproj" />

src/ASPNETCoreIdentitySample.DataLayer.MSSQL/ASPNETCoreIdentitySample.DataLayer.MSSQL.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\ASPNETCoreIdentitySample.DataLayer\ASPNETCoreIdentitySample.DataLayer.csproj" />

src/ASPNETCoreIdentitySample.DataLayer.SQLite/ASPNETCoreIdentitySample.DataLayer.SQLite.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\ASPNETCoreIdentitySample.DataLayer\ASPNETCoreIdentitySample.DataLayer.csproj" />

src/ASPNETCoreIdentitySample.DataLayer/ASPNETCoreIdentitySample.DataLayer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\ASPNETCoreIdentitySample.Entities\ASPNETCoreIdentitySample.Entities.csproj" />

src/ASPNETCoreIdentitySample.Entities/ASPNETCoreIdentitySample.Entities.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\ASPNETCoreIdentitySample.Common\ASPNETCoreIdentitySample.Common.csproj" />

src/ASPNETCoreIdentitySample.IocConfig/ASPNETCoreIdentitySample.IocConfig.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\ASPNETCoreIdentitySample.Common\ASPNETCoreIdentitySample.Common.csproj" />

src/ASPNETCoreIdentitySample.MsTests/ASPNETCoreIdentitySample.MsTests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<None Include="..\ASPNETCoreIdentitySample\appsettings.json" CopyToOutputDirectory="PreserveNewest" />

src/ASPNETCoreIdentitySample.Services/ASPNETCoreIdentitySample.Services.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\ASPNETCoreIdentitySample.Common\ASPNETCoreIdentitySample.Common.csproj" />

src/ASPNETCoreIdentitySample.Services/Identity/CustomNormalizer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private static string FixGmailDots(string email)
4545
var emailParts = email.Split('@');
4646
var name = emailParts[0].Replace(".", string.Empty, StringComparison.OrdinalIgnoreCase);
4747

48-
var plusIndex = name.IndexOf("+", StringComparison.OrdinalIgnoreCase);
48+
var plusIndex = name.IndexOf('+', StringComparison.OrdinalIgnoreCase);
4949
if (plusIndex != -1)
5050
{
5151
name = name.Substring(0, plusIndex);

src/ASPNETCoreIdentitySample.Services/Identity/CustomSecurityStampValidator.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,21 @@ namespace ASPNETCoreIdentitySample.Services.Identity;
1313
/// </summary>
1414
public class CustomSecurityStampValidator : SecurityStampValidator<User>
1515
{
16-
private readonly ISystemClock _clock;
1716
private readonly IOptions<SecurityStampValidatorOptions> _options;
1817
private readonly IApplicationSignInManager _signInManager;
1918
private readonly ISiteStatService _siteStatService;
2019

2120
public CustomSecurityStampValidator(
2221
IOptions<SecurityStampValidatorOptions> options,
2322
IApplicationSignInManager signInManager,
24-
ISystemClock clock,
2523
ISiteStatService siteStatService,
2624
ILoggerFactory logger)
27-
: base(options, (SignInManager<User>)signInManager, clock, logger)
25+
: base(options, (SignInManager<User>)signInManager, logger)
2826
{
2927
_options = options ?? throw new ArgumentNullException(nameof(options));
3028
_signInManager = signInManager ?? throw new ArgumentNullException(nameof(signInManager));
3129
_siteStatService = siteStatService ?? throw new ArgumentNullException(nameof(siteStatService));
32-
_clock = clock;
30+
3331
}
3432

3533
public TimeSpan UpdateLastModifiedDate { get; set; } = TimeSpan.FromMinutes(2);
@@ -48,9 +46,9 @@ private async Task UpdateUserLastVisitDateTimeAsync(CookieValidatePrincipalConte
4846
}
4947

5048
var currentUtc = DateTimeOffset.UtcNow;
51-
if (context.Options != null && _clock != null)
49+
if (context.Options != null)
5250
{
53-
currentUtc = _clock.UtcNow;
51+
currentUtc = TimeProvider.GetUtcNow();
5452
}
5553

5654
var issuedUtc = context.Properties.IssuedUtc;

src/ASPNETCoreIdentitySample.Services/Identity/Logger/DbLogger.cs

+6-9
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,16 @@ public void Log<TState>(
7676
SetStateJson(state, appLogItem);
7777
_loggerProvider.AddLogItem(new LoggerItem { Props = props, AppLogItem = appLogItem });
7878
}
79-
79+
private static readonly JsonSerializerOptions JsonSerializerOptions = new JsonSerializerOptions
80+
{
81+
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
82+
WriteIndented = true,
83+
};
8084
private static void SetStateJson<TState>(TState state, AppLogItem appLogItem)
8185
{
8286
try
8387
{
84-
appLogItem.StateJson = JsonSerializer.Serialize(
85-
state,
86-
new JsonSerializerOptions
87-
{
88-
DefaultIgnoreCondition =
89-
JsonIgnoreCondition.WhenWritingNull,
90-
WriteIndented = true,
91-
});
88+
appLogItem.StateJson = JsonSerializer.Serialize(state, JsonSerializerOptions);
9289
}
9390
catch
9491
{

src/ASPNETCoreIdentitySample.ViewModels/ASPNETCoreIdentitySample.ViewModels.csproj

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
</PropertyGroup>
55
<ItemGroup>
66
<ProjectReference Include="..\ASPNETCoreIdentitySample.Entities\ASPNETCoreIdentitySample.Entities.csproj" />
@@ -12,4 +12,34 @@
1212
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" />
1313
<PackageReference Include="System.ComponentModel.Annotations" />
1414
</ItemGroup>
15+
<ItemGroup>
16+
<PackageReference Update="Meziantou.Analyzer">
17+
<PrivateAssets>all</PrivateAssets>
18+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19+
</PackageReference>
20+
<PackageReference Update="Microsoft.EntityFrameworkCore.Analyzers">
21+
<PrivateAssets>all</PrivateAssets>
22+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23+
</PackageReference>
24+
<PackageReference Update="Microsoft.EntityFrameworkCore.Design">
25+
<PrivateAssets>all</PrivateAssets>
26+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
27+
</PackageReference>
28+
<PackageReference Update="Microsoft.EntityFrameworkCore.Tools">
29+
<PrivateAssets>all</PrivateAssets>
30+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
31+
</PackageReference>
32+
<PackageReference Update="Microsoft.VisualStudio.Threading.Analyzers">
33+
<PrivateAssets>all</PrivateAssets>
34+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
35+
</PackageReference>
36+
<PackageReference Update="Roslynator.Analyzers">
37+
<PrivateAssets>all</PrivateAssets>
38+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
39+
</PackageReference>
40+
<PackageReference Update="SonarAnalyzer.CSharp">
41+
<PrivateAssets>all</PrivateAssets>
42+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
43+
</PackageReference>
44+
</ItemGroup>
1545
</Project>

src/ASPNETCoreIdentitySample/ASPNETCoreIdentitySample.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net8.0</TargetFramework>
44
<OutputType>Exe</OutputType>
55
</PropertyGroup>
66
<ItemGroup>

src/ASPNETCoreIdentitySample/Views/Shared/_Layout.cshtml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<div class="text-center footer-text">
8080
<span class="copyright-text">
8181
<span class="fas fa-heart" style="color:DarkRed" aria-hidden="true"></span>
82-
<a href="http://www.dntips.ir/" target="_blank">DNT, 2017</a>
82+
<a href="http://www.dntips.ir/" target="_blank">DNT, 2024</a>
8383
</span>
8484
</div>
8585
</div>

0 commit comments

Comments
 (0)