Exemplo n.º 1
0
        public async Task <IActionResult> Put(int id, [FromBody] DetailViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            viewModel.Id = id;
            await _detailService.UpdateAsync(viewModel.ToDto(), Bll.Extensions.DetailExtensions.ToEntity);

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Update(DetailModel detailModel)
        {
            await _detailService.UpdateAsync(detailModel);

            return(View(detailModel));
        }
 public async Task <Detail> Update(DetailModel detail)
 {
     return(await detailService.UpdateAsync(detail));
 }