Visual Studio 2015 のスキャフォールディングではUserManager<TUser>
、これを使用して作成することはできませんClaimsIdentity
。これを行う方法に関する実用的な例はありますか?
VS2015 スキャフォールディングがエラーをスローします。
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;
}
注意:ApplicationUser
と競合しないプロパティを追加しましたIdentyUser
。