2016-08-21 2 views
2

나는 내가 "TwoFactorEnabled"와 같은 데이터베이스에 어떤 값을 보내지 않으 기본 클래스에서 다음 클래스제외 특성

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; } 
} 

이 , "PhoneNumberConfirmed"등

Microsoft.AspNet.Identity.EntityFramework.IdentityDbContextOnModelCreating을 무시할 수 없기 때문에 데이터베이스에서 제외 할 수 없습니다.

따라서이 속성을 내 dbcontext에서 어떻게 제외시킬 수 있습니까?

+0

당신은'IdentityUser'에서 파생되는 대신'IUser '을 구현할 수 있습니다. 그런 다음 원하는대로 사용자 정의 할 수 있습니다. –

답변

0

나는 자기 답을 찾았습니다. IdentityDbContext 클래스에는 DbContext 클래스와 같이 OnModelCreating이라는 보호 된 메서드가 있습니다. 거기에 내가 원하는 값을 제외 할 수 있습니다