Exemplo n.º 1
0
        public async Task <IActionResult> GetAll()
        {
            var result = await _showingService.GetAll();

            var res = _mapper.Map <IEnumerable <ProductModel> >(result);

            if (result != null)
            {
                return(Ok(res));
            }
            else
            {
                return(BadRequest(res));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets list of all showings.
        /// </summary>
        /// <returns></returns>
        public ObservableCollection <Showing> GetShowings()
        {
            var data = _showingService.GetAll();
            var list = new ObservableCollection <Showing>();

            foreach (ShowingDto show in data)
            {
                list.Add(new Showing()
                {
                    Id              = show.Id,
                    MovieId         = show.MovieId,
                    MovieTitle      = show.MovieTitle,
                    TheatreId       = show.TheatreId,
                    ShowingDateTime = show.ShowingDateTime
                });
            }
            return(list);
        }
Exemplo n.º 3
0
 public IHttpActionResult Get()
 {
     return(Json(_showingService.GetAll()));
 }