Exemple #1
0
        public async Task <IActionResult> Edit(int id, ContactInformation contact)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Edit", id));
            }
            if (id != contact.ContactId)
            {
                return(RedirectToAction("Edit", id));
            }
            try
            {
                await _con.UpdateContactInfoById(contact);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(RedirectToAction("Error", "Home"));
            }
        }