public async Task <List <Vehiculo> > GetAllAsync(int?pageNumber) { var list = new List <Vehiculo>(); int rowsPerPage = 5; KeyValuePair <int, IEnumerable <Vehiculo> > keypair; if (!pageNumber.HasValue) { keypair = await _vehiculoRepo.GetAllPagedAsync(null, null); } else { keypair = await _vehiculoRepo.GetAllPagedAsync(pageNumber.Value, rowsPerPage); //vehiculoResponse.PagingSettings.TotalRecords = keypair.Key; //vehiculoResponse.PagingSettings.PageNumber = pageNumber.Value; //vehiculoResponse.PagingSettings.RowsPerPage = rowsPerPage; } if (keypair.Value.ToList().Count == 0) { //vehiculoResponse.Message = "Vehiculos not found."; } else { //vehiculoResponse.Vehiculos.AddRange(keypair.Value); list.AddRange(keypair.Value); } return(list); }