Esempio n. 1
0
        public async Task <PlanePageVM> GetPlanePageViewModelAsync(string searchString, int pageIndex = 1)
        {
            // var movies = await _service.GetMoviesAsync(searchString, genre);
            var Planes = await _service.getAvailablePlaneAsync();

            if (searchString != null)
            {
                // var makerName = _service.Makers.get;
                Planes = await _service.getPlaneByMakerIdAsync(searchString.Substring(0, 3));
            }
            Planes = await _service.SortAsync(Planes, ApplicationCore.ORDER_ENUM.ID, ApplicationCore.ORDER_ENUM.ASCENDING);

            return(new PlanePageVM
            {
                Planes = PaginatedList <PlaneDTO> .Create(Planes, pageIndex, pageSize)
            });
        }