Example #1
0
        public async Task <IActionResult> Edit(int id, Partner partner)
        {
            if (id != partner.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    await _partnerRepository.UpdateAsync(partner);
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!await _partnerRepository.ExistsAsync(partner.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(partner));
        }