2
我有下面的類不含屬性
public class AppUser : Microsoft.AspNet.Identity.EntityFramework.IdentityUser<int, AppLogin, AppUserRole, AppClaim>
{
public AppUser()
: base()
{
}
public System.DateTime DateCreated { get; set; }
public DateTime? LastActivityDate { get; set; }
}
從基類我不想發送到數據庫中的一些的值,如「TwoFactorEnabled
」 ,「PhoneNumberConfirmed
」等。
但我不能排除然後從數據庫中,因爲Microsoft.AspNet.Identity.EntityFramework.IdentityDbContext
不允許我覆蓋OnModelCreating
。
那麼,如何從我的dbcontext
中排除此屬性?
您可以實現'IUser'而不是從'IdentityUser'派生。然後你可以自定義你想要的 –