Esempio n. 1
0
        public async Task <IPagedList <VehicleModel> > GetVehicleModelsAsync(ISortParameters sort, IFilterParameters filter, IPageParameters pagep)
        {
            var modelList = await _repository.GetVehicleModelsAsync(sort, filter, pagep);

            var makeVMList = AutoMapper.Mapper.Map <IEnumerable <VehicleModel> >(modelList);

            return(new StaticPagedList <VehicleModel>(makeVMList, modelList.GetMetaData()));
        }
Esempio n. 2
0
 /// <summary>
 /// Read method,
 /// gets a list of VehicleModels from VehicleModel Repository,
 /// does sorting, filtering and pagging.
 /// </summary>
 /// <param name="sortParameters">Has 2 properties: Sort and Sort Direction.</param>
 /// <param name="filterParameters">Has 2 properties: Search and MakeId.</param>
 /// <param name="pageParameters">Has 2 properties: Page and PageSize.</param>
 /// <returns>Retuns a list of paged, sorted and filtered IVehicleModel.</returns>
 public async Task <IPagedResult <IVehicleModel> > GetVehicleModelsAsync(ISortParameters sortParameters, IFilterParameters filterParameters, IPageParameters pageParameters)
 {
     return(await repository.GetVehicleModelsAsync(sortParameters, filterParameters, pageParameters));
 }