12

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

4

2 に答える 2