public async Task Update(int id, ServiceCategoryUpdateDTO model) { var entry = _context.ServiceCategories.Single(x => x.ServiceCategoryId == id); entry.ServiceCategoryId = model.ServiceCategoryId; entry.Name = model.Name; await _context.SaveChangesAsync(); }
public async Task <ActionResult> Update(int id, ServiceCategoryUpdateDTO model) { if (_ServiceCategoryService.Existencia(id) == true) { await _ServiceCategoryService.Update(id, model); return(NoContent()); } else { return(NotFound()); } }