In My Project I'm Using Repository pattern, So I Want to use my Own class instead of ApplicationUser
Class.
So I have Customize the DbContext
Class accordingly.
This is my class which I want to use in place of ApplicationUser.
public class AppUser : IdentityUser
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string Email { get; set; }
public string ConfirmationCode { get; set; }
public DateTime ConfirmationCodeSentDate { get; set; }
[Key]
public int Identifier {get;set;}
public DateTime DateCreated { get; set; }
public DateTime LastModified {get; set;}
public bool IsRemoved { get; set;}
}
My Context Class is as follow.
public class TestArchDbContext : IdentityDbContext<AppUser>
{
public TestArchDbContext()
: base("TestArchDb")
{
}
public IDbSet<Result> Results { get; set; }
public static TestArchDbContext Create()
{
return new TestArchDbContext();
}
}
Now There is code in GetExternalLogin
Method in AccountController
AppUser user = await UserManager.FindAsync(new UserLoginInfo(externalLogin.LoginProvider,
externalLogin.ProviderKey));
ClaimsIdentity oAuthIdentity = await user.GenerateUserIdentityAsync(UserManager,
OAuthDefaults.AuthenticationType);
ClaimsIdentity cookieIdentity = await user.GenerateUserIdentityAsync(UserManager,
CookieAuthenticationDefaults.AuthenticationType);
I'm getting error that AppUser doesn't contain the defination of
GenerateUserIdentityAsync
.
Where do I have to write this method.