Beispiel #1
0
        public async Task <IActionResult> Put(long id, [FromBody] DobrasCutaneasInputDTO inputDTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var dobrasCutaneas = new DobrasCutaneas(inputDTO.Triciptal, inputDTO.Subescapular, inputDTO.Biciptal, inputDTO.AxilarMedia, inputDTO.SupraIliaca,
                                                        inputDTO.Toracica, inputDTO.Coxa, inputDTO.Abdominal, inputDTO.PanturrilhaMedial, inputDTO.AlunoId);
                dobrasCutaneas.Id = id;
                var result = await _service.Put(dobrasCutaneas);

                if (result != null)
                {
                    return(Ok(result));
                }
                else
                {
                    return(BadRequest());
                }
            }
            catch (ArgumentException e)
            {
                return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message));
            }
        }
Beispiel #2
0
 public async Task <DobrasCutaneas> Put(DobrasCutaneas dobrasCutaneas)
 {
     return(await _repository.UpdateAsync(dobrasCutaneas));
 }
Beispiel #3
0
 public async Task <DobrasCutaneas> Post(DobrasCutaneas dobrasCutaneas)
 {
     return(await _repository.InsertAsync(dobrasCutaneas));
 }