public HttpResponseMessage Update([FromBody] ClientView inst)
 {
     if (inst == null)
     {
         ModelState.AddModelError("UpdateClient", "Не указаны данные для обновления клиента!!!");
         HttpResponseMessage resp = Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
         return(resp);
     }
     if (ModelState.IsValid)
     {
         clientService.Update(inst.ClientFromViewToDomain());
         HttpResponseMessage response = Request.CreateResponse <string>(HttpStatusCode.OK, "Client is updated!!");
         return(response);
     }
     else
     {
         HttpResponseMessage resp = Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
         return(resp);
     }
 }
Beispiel #2
0
 public void Update([FromBody] ClientView inst)
 {
     clientService.Update(inst.ClientFromViewToDomain());
 }