public async Task<ActionResult> ManageNewUsers(NewUsersListViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            var message = new SetUserApprovals(
                model.Users
                    .Where(u => u.Action.HasValue)
                    .Select(u => new UserApproval(u.UserData.Id, u.Action.Value, u.AssignedRole))
                    .ToList());

            await mediator.SendAsync(message);

            return RedirectToAction("Index", "Home");
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> ManageNewUsers(NewUsersListViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var message = new SetUserApprovals(
                model.Users
                .Where(u => u.Action.HasValue)
                .Select(u => new UserApproval(u.UserData.Id, u.Action.Value, u.AssignedRole))
                .ToList());

            await mediator.SendAsync(message);

            return(RedirectToAction("Index", "Home"));
        }