Exemple #1
0
 public Task <bool> IsInRoleAsync(User user, string roleName)
 {
     return(Task.FromResult(RoleExtensions.RoleCheck(roleName).Equals(user.Role.ToString())));
 }
Exemple #2
0
 public Task AddToRoleAsync(User user, string roleName) //реализация интерфейса IUserRoleStore
 {
     user.Role = RoleExtensions.RoleCheck(roleName);
     return(Task.Run(() => session.SaveOrUpdate(user)));
 }