public virtual IActionResult GetVenueById([FromRoute] int?venueId) { var result = _venueRepository.GetVenueById((int)venueId); if (result == null) { return(BadRequest()); } return(new ObjectResult(result)); }
public IActionResult GetById(int venueId) { VenueRepository venueRepo = new VenueRepository(_context); var venue = _context.Venue.FirstOrDefault(v => v.VenueId == venueId); if (venue == null) { return(NotFound($"Venue '{venueId}' Not Found")); } return(new ObjectResult(venueRepo.GetVenueById(venue))); }