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)); } }
/// <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); }
public IHttpActionResult Get() { return(Json(_showingService.GetAll())); }