public ActionResult Provisioning(ProvisioningViewModel vm) { if (!vm.ProvisioningInformation.Any(p => p.Select && string.IsNullOrEmpty(p.SiteUrl))) { var commands = vm.ProvisioningInformation.Where(p => p.Select).Select(p => new ForceProvisioningCompletionCommand { ProjectId = p.Id, SiteUrl = p.SiteUrl }).ToList(); commands.ForEach(c => _bus.Send<ForceProvisioningCompletionCommand> (m => { m.ProjectId = c.ProjectId; m.SiteUrl = c.SiteUrl; } )); ViewBag.Message = "Provisioning requests updated; refresh in a few minutes to see the result."; } else { ViewBag.Message = "Invalid request(s) selected; ensure all selected requests have a site url."; } vm.Projects = _projectRepository.GetAllWhichFailedProvisioning(); return View(vm); }
public ActionResult Provisioning() { var projects = _projectRepository.GetAllWhichFailedProvisioning(); var vm = new ProvisioningViewModel { Projects = projects }; return View(vm); }