public async Task <IActionResult> ReplaceVenue([FromRoute(Name = "venueId")] int venueId, [FromBody] NewVenue venue) { var newVenue = new Venue { VenueId = venueId, CompanyId = venue.CompanyId, VenueName = venue.VenueName, VenueCode = venue.VenueCode, VenueAddress = venue.VenueAddress, VenuePostCode = venue.VenuePostCode, VenueContact = venue.VenueContact, VenueDescription = venue.VenueDescription, VenueNotes = venue.VenueNotes, VenueLatitude = venue.VenueLatitude, VenueLongitude = venue.VenueLongitude, ImageId = venue.ImageId, VenuePhone = venue.VenuePhone, }; return(await venues.ReplaceVenue(newVenue) .OnBoth(v => v.IsFailure ? StatusCode(500) : StatusCode(200)) .ConfigureAwait(false)); }