public async Task <IActionResult> Expense(SplitExpenseVM viewModel) { if (!ModelState.IsValid) { var myUser = await userManager.GetUserAsync(HttpContext.User); User currentUser = mysticoContext.GetUserByAspUserId(myUser.Id); viewModel.CurrencyItem = Library.ConvertCurrencyToSelectListItem(mysticoContext.GetAllCurrencies()); viewModel.EventItem = Library.ConvertEventToSelectListItem(mysticoContext.GetActiveEventsByUserId(currentUser.Id)); viewModel.Date = DateTime.Today.ToString("u").Replace(" 00:00:00Z", ""); return(View(viewModel)); } var expenseId = await mysticoContext.CreateExpense(viewModel); mysticoContext.CreatePayerForExpense(viewModel.FriendIds, expenseId); return(RedirectToAction(nameof(SplitController.Overview), nameof(SplitController).Replace("Controller", ""), new { id = viewModel.SelectedEvent })); }