Example #1
0
        public async Task <IActionResult> GetShow(int id)
        {
            var show = await showsRepository.GetShowById(id);

            if (show != null)
            {
                return(Ok(show));
            }

            return(BadRequest());
        }
Example #2
0
        public static bool UpdateShow(int id, string name, int price, string description)
        {
            Show currentShow = ShowsRepository.GetShowById(id);

            if (currentShow != null)
            {
                currentShow.Name        = name;
                currentShow.Price       = price;
                currentShow.Description = description;

                return(ShowsRepository.UpdateShow(currentShow));
            }

            return(false);
        }
Example #3
0
 public static Show GetShowById(int id)
 {
     return(ShowsRepository.GetShowById(id));
 }