Forum Discussion
Stesvis
Nov 30, 2023Copper Contributor
Custom IdentityRole in .NET 8
I am working on a .NET 8 API project and I had to customize the IdentityRole to add an extra column Order, so I created a custom ApplicationRole class: public class ApplicationRole : Identit...
PasildaData
Dec 01, 2023Copper Contributor
Stesvisyou could try .AddRoles<ApplicationRole>() in your services:
builder.Services
.AddIdentity<ApplicationUser, ApplicationRole>()
.AddRoles<ApplicationRole>()
.AddEntityFrameworkStores<ApplicationDbContext>()
.AddDefaultTokenProviders();
- StesvisDec 04, 2023Copper Contributor
PasildaData I eventually removed this from ApplicationRole and the error was gone:
public ICollection<ApplicationUser>? Users { get; set; }