public Task AddToRoleAsync(ApplicationUser user, string roleName) { if (user != null) { return(Task.Factory.StartNew(() => { AccountRoleController.NewUserRole(user.Id, roleName); })); } else { throw new ArgumentNullException("user"); } }
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"); }