public IHttpActionResult Put([FromBody] dynamic data) { int id = (int)data.Id.Value; BookiAPI.DataAccessLayer.Models.Venue newVenue = new BookiAPI.DataAccessLayer.Models.Venue { Name = data.Venue.Name.Value == null ? "" : data.Venue.Name.Value, Address = data.Venue.Address.Value == null ? "" : data.Venue.Address.Value, Zip = data.Venue.Address.Value == null ? 0 : (int)data.Venue.Zip.Value, City = data.Venue.City.Value == null ? "" : data.Venue.City.Value }; if (_venueRepository.Update(id, newVenue)) { return(Ok($"Venue with ID: {id} was updated")); } else { return(BadRequest("Something went wrong ..")); } }
public int update(Venue cat) { return(vanRepo.Update(cat)); }