Exemplo n.º 1
0
        public virtual IActionResult GetVenueById([FromRoute] int?venueId)
        {
            var result = _venueRepository.GetVenueById((int)venueId);

            if (result == null)
            {
                return(BadRequest());
            }
            return(new ObjectResult(result));
        }
Exemplo n.º 2
0
        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)));
        }