public async Task Update(int id, LocationUpdateDTO model) { var entry = _context.Locations.Single(x => x.LocationId == id); entry.LocationId = model.LocationId; entry.Country = model.Country; entry.City = model.City; entry.Address = model.Address; await _context.SaveChangesAsync(); }
public async Task <ActionResult> Update(int id, LocationUpdateDTO model) { if (_LocationService.Existencia(id) == true) { await _LocationService.Update(id, model); return(NoContent()); } else { return(NotFound()); } }