AspNetCore.Identity.MongoDbCore icon indicating copy to clipboard operation
AspNetCore.Identity.MongoDbCore copied to clipboard

Is It Possible to Remove ApplicationUser Properties?

Open BeeFriedman opened this issue 8 months ago • 0 comments

When using Microsoft's Identity package it's possible to disable ApplicationUser properties by overriding the dbContext OnModelCreating method as follows:

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
        base.OnModelCreating(modelBuilder);
        modelBuilder.Entity<IdentityUser>().Ignore(c => c.AccessFailedCount)
                                           .Ignore(c=> c.LockoutEnabled)
                                           .Ignore(c=>c.LockoutEndDateUtc)
                                           .Ignore(c=>c.Roles)
                                           .Ignore(c=>c.TwoFactorEnabled);//and so on...

        modelBuilder.Entity<IdentityUser>().ToTable("Users");//to change the name of table.

}

Is there a way to do this when using this package to connect to a MongoDB database?

BeeFriedman avatar Jun 24 '24 19:06 BeeFriedman