Beispiel #1
0
 public Task AddToRoleAsync(ApplicationUser user, string roleName)
 {
     if (user != null)
     {
         return(Task.Factory.StartNew(() =>
         {
             AccountRoleController.NewUserRole(user.Id, roleName);
         }));
     }
     else
     {
         throw new ArgumentNullException("user");
     }
 }
Beispiel #2
0
 public Task CreateAsync(ApplicationUser user)
 {
     if (user != null)
     {
         return(Task.Factory.StartNew(() =>
         {
             user.Id = Guid.NewGuid().ToString();
             user.Status = Models.EnumAccountStatus.Active;
             AccountRoleController.NewUserRole(user.Id, "Student");
             AccountController.NewUser(user);
         }));
     }
     throw new ArgumentNullException("user");
 }