1
У меня есть этот код для определения моего ApplicaitonUser. Имя и Создать - это настраиваемые поля, которые я добавил.Добавить пользовательское поле в роли MVC SimpleMembership
Как сделать то же самое для ролей? Мне нужно добавить к ним целое поле.
public class ApplicationUser : IdentityUser
{
public DateTime Created { get; set; }
public string Name { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
public ApplicationUser()
{
Created = DateTime.UtcNow;
}
}