Exemplo n.º 1
0
 public HttpResponseMessage Update(ContactInfoDetailDto contact)
 {
     try
     {
         _contactCrudService.UpdateContactInfo(contact);
         return(Request.CreateResponse(HttpStatusCode.OK, contact));
     }
     catch (ValidationException ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex.Message));
     }
 }
Exemplo n.º 2
0
 public ActionResult Edit(ContactInfoDetailDto contactInfoDetailDto)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _contactCrudService.UpdateContactInfo(contactInfoDetailDto);
             return(RedirectToAction("Edit", "Contacts", new { id = contactInfoDetailDto.ContactId }));
         }
         catch (ValidationException ex)
         {
             ModelState.AddValidationErrors(ex);
         }
     }
     return(View(contactInfoDetailDto));
 }