public IActionResult CreateSystem(CreateSystemViewModel model) { if (!ModelState.IsValid) { return(View(nameof(ListSystem), model)); } var result = _monitor.CreateSystem(model, GetCurrentUserAsync().Result.UserName).Result; if (result.Succeeded) { _toastNotification.AddSuccessToastMessage(result.OkMessage, new ToastrOptions() { PositionClass = ToastPositions.TopCenter }); return(RedirectToAction("ListSystem")); } _toastNotification.AddErrorToastMessage(result.Errors, new ToastrOptions() { PositionClass = ToastPositions.TopCenter }); ViewBag.VendorList = from v in _monitor.VendorSelectList(-1) select new { VendorId = v.Id, VendorName = v.Name }; ViewBag.EnvironmentList = _monitor.EnvironmentSelectList(-1); return(View(nameof(CreateSystem), model)); }