Exemplo n.º 1
0
        public async Task <IActionResult> Upsert(ONGViewModel ongViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(ongViewModel));
            }

            if (ongViewModel.Id == Guid.Empty)
            {
                await _ongAppService.Create(ongViewModel);
            }
            else
            {
                await _ongAppService.Update(ongViewModel);
            }

            TempData[TempDataConstants.ShowAlert] = AlertFactory.NewONGCreated();

            return(RedirectToAction("Index"));
        }