Skip to content

Commit 1987b73

Browse files
committed
Updated to .Net 9.0
1 parent e6f0969 commit 1987b73

File tree

4 files changed

+682
-675
lines changed

4 files changed

+682
-675
lines changed

src/Host/Host.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="3.1.1" />
9-
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="3.1.1" />
8+
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="9.0.10" />
9+
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="9.0.10" />
1010
</ItemGroup>
1111

1212
<ItemGroup>

src/Host/Startup.cs

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
1-
using IdentityManager2.AspNetIdentity;
2-
using Microsoft.AspNetCore.Builder;
3-
using Microsoft.AspNetCore.Identity;
4-
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
5-
using Microsoft.EntityFrameworkCore;
6-
using Microsoft.Extensions.DependencyInjection;
7-
8-
namespace Host
9-
{
10-
public class Startup
11-
{
12-
public void ConfigureServices(IServiceCollection services)
13-
{
14-
services.AddDbContext<IdentityDbContext>(opt => opt.UseInMemoryDatabase("test"));
15-
16-
services.AddIdentity<IdentityUser, IdentityRole>()
17-
.AddEntityFrameworkStores<IdentityDbContext>()
18-
.AddDefaultTokenProviders();
19-
20-
services.AddIdentityManager()
21-
.AddIdentityMangerService<AspNetCoreIdentityManagerService<IdentityUser, string, IdentityRole, string>>();
22-
}
23-
24-
public void Configure(IApplicationBuilder app)
25-
{
26-
app.UseDeveloperExceptionPage();
27-
28-
app.UseRouting();
29-
30-
app.UseAuthentication();
31-
app.UseAuthorization();
32-
33-
app.UseIdentityManager();
34-
35-
app.UseEndpoints(x => x.MapDefaultControllerRoute());
36-
}
37-
}
38-
}
1+
using IdentityManager2.AspNetIdentity;
2+
using Microsoft.AspNetCore.Builder;
3+
using Microsoft.AspNetCore.Identity;
4+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
5+
using Microsoft.EntityFrameworkCore;
6+
using Microsoft.Extensions.DependencyInjection;
7+
8+
namespace Host
9+
{
10+
public class Startup
11+
{
12+
public void ConfigureServices(IServiceCollection services)
13+
{
14+
services.AddDbContext<IdentityDbContext>(opt => opt.UseInMemoryDatabase("test"));
15+
16+
services.AddIdentity<IdentityUser, IdentityRole>(options =>
17+
{
18+
options.Password.RequireDigit = false;
19+
options.Password.RequireLowercase = false;
20+
options.Password.RequireNonAlphanumeric = false;
21+
options.Password.RequireUppercase = false;
22+
options.Password.RequiredLength = 4;
23+
})
24+
.AddEntityFrameworkStores<IdentityDbContext>()
25+
.AddDefaultTokenProviders();
26+
27+
services.AddIdentityManager()
28+
.AddIdentityMangerService<AspNetCoreIdentityManagerService<IdentityUser, string, IdentityRole, string>>();
29+
}
30+
31+
public void Configure(IApplicationBuilder app)
32+
{
33+
app.UseDeveloperExceptionPage();
34+
35+
app.UseRouting();
36+
37+
app.UseAuthentication();
38+
app.UseAuthorization();
39+
40+
app.UseIdentityManager();
41+
42+
app.UseEndpoints(x => x.MapDefaultControllerRoute());
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)