public async Task <IActionResult> Create(CreateBarVM barVM) { if (ModelState.IsValid) { try { var barDTO = barVM.MapBarVMToDTO(); var barName = await _barServices.AddBarAsync(barDTO); //notification for admin string id = this.User.FindFirstValue(ClaimTypes.NameIdentifier); await _notificationServices.BarCreateNotificationToAdminAsync(id, barName); _toast.AddSuccessToastMessage($"You successfully added \"{barName}\" bar!"); return(RedirectToAction(nameof(ListBars))); } catch (Exception ex) { _toast.AddErrorToastMessage(ex.Message); ViewBag.ErrorTitle = ""; return(View("Error")); } } var allCocktails = await _cocktailServices.GetAllCocktails(); var allCountries = await _barServices.GetAllCountries(); barVM.AllCocktails = allCocktails .Select(c => new SelectListItem(c.Name, c.Id)).ToList(); barVM.AllCountries = allCountries .Select(c => new SelectListItem(c.Name, c.Id)).ToList(); return(View(barVM)); }