Exemplo n.º 1
0
 public UserReturnModel Create(UserIdentity appUser)
 {
     return new UserReturnModel
     {
         Url = urlHelper.Link("GetUserById", new { id = appUser.Id }),
         Id = appUser.Id,
         UserName = appUser.UserName,
         FullName = string.Format("{0} {1}", appUser.FirstName, appUser.LastName),
         Email = appUser.Email,
         EmailConfirmed = appUser.EmailConfirmed,
         Roles = appUserManager.GetRolesAsync(appUser.Id).Result,
         Claims = appUserManager.GetClaimsAsync(appUser.Id).Result
     };
 }
 public async Task<ClaimsIdentity> GenerateClaims(UserIdentity user, string authenticationType)
 {
     var userIdentity = await userManager.CreateIdentityAsync(user, authenticationType);
     // Add custom user claims here
     return userIdentity;
 }