如何省略IdentityUser对象的某些字段

时间:2017-11-15 11:54:02

标签: asp.net asp.net-identity

  • IdentityUser字段

    public virtual bool PhoneNumberConfirmed { get; set; } public virtual bool TwoFactorEnabled { get; set; } public virtual string SecurityStamp { get; set; } public virtual DateTime? LockoutEndDateUtc { get; set; }

1 个答案:

答案 0 :(得分:0)

忽略IdentityUser中的所需字段

   modelBuilder.Entity<IdentityUser>().Ignore(c => c.PhoneNumberConfirmed )
                                           .Ignore(c=> c.TwoFactorEnabled )
                                           .Ignore(c=>c.SecurityStamp )
                                           .Ignore(c=>c.LockoutEndDateUtc