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 userIdentity.AddClaim(new Claim("NickName", NickName.ToString())); return(userIdentity); }
/// <summary> /// Override of ToString in order to get information needed. /// </summary> /// <returns>string</returns> public override string ToString() { return(Id.ToString() + NickName.ToString() + Age.ToString() + Role.ToString() + TeamId.ToString()); }