public async Task <HttpResponseMessage> Paging(int pageSize, int pageIndex) { if (!ModelState.IsValid) { return(Request.CreateResponse(HttpStatusCode.BadRequest, "Invalid data")); } IEnumerable <VehicleModelServ> vehicleModelServs = await VehicleModelService.Paging(pageSize, pageIndex); List <VehicleModel> vehicleModels = new List <VehicleModel>(); vehicleModels = mapper.Map <IEnumerable <VehicleModelServ>, List <VehicleModel> >(vehicleModelServs); return(Request.CreateResponse(HttpStatusCode.OK, vehicleModels)); }