Skip to content

Commit

Permalink
Merge pull request #38 from AydinAdn/Rick-Anderson-patch-3
Browse files Browse the repository at this point in the history
Rick anderson patch 3
  • Loading branch information
meslubi2021 authored Dec 20, 2024
2 parents 343514b + 63a95d2 commit acd7335
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aspnetcore/migration/20_21/sample/Startup2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public void ConfigureServices(IServiceCollection services)
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));

// There is no overload for TRole, so if using the RoleManager chain .AddRoles<TRole>
// before .AddEntityFrameworkStores
// services.AddDefaultIdentity<ApplicationUser>()
//.AddRoles<IdentityRole> This must come before AddEntityFrameworkStores

// Change services.AddIdentity to AddDefaultIdentity
services.AddDefaultIdentity<ApplicationUser>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
Expand Down

0 comments on commit acd7335

Please sign in to comment.