public async Task Update(int id, ServiceUpdateDTO model) { var entry = _context.Services.Single(x => x.ServiceId == id); entry.ServiceId = model.ServiceId; entry.Name = model.Name; entry.Description = model.Description; entry.Price = model.Price; await _context.SaveChangesAsync(); }
public async Task <ActionResult> Update(int id, ServiceUpdateDTO model) { if (_ServiceService.Existencia(id) == true) { await _ServiceService.Update(id, model); return(NoContent()); } else { return(NotFound()); } }