public string update([FromBody] Location locationModel) { try { var model = _context.Locations.FirstOrDefault(i => i.Id == locationModel.Id); if (model == null) { return("404"); } model.LocationLatLong = locationModel.LocationLatLong; model.LocationShortName = locationModel.LocationShortName; model.LocationTitle = locationModel.LocationTitle; model.LocationTypeId = locationModel.LocationTypeId; _context.Entry(model).State = EntityState.Modified; _context.SaveChanges(); return("true"); } catch (Exception ex) { return(ex.Message.ToString()); } }