internal EntityCollection <TEntity> Fetch(IDataAccessAdapter adapter, SortExpression sortExpression, ExcludeIncludeFieldsList excludedIncludedFields, IPrefetchPath2 prefetchPath, IRelationPredicateBucket predicateBucket, int pageNumber, int pageSize, int limit, out int totalItemCount) { var entities = new EntityCollection <TEntity>(new TEntityFactory()); totalItemCount = adapter.GetDbCount(entities, predicateBucket); if (limit > 0) { adapter.FetchEntityCollection(entities, predicateBucket, limit, sortExpression, prefetchPath, excludedIncludedFields); } else { adapter.FetchEntityCollection(entities, predicateBucket, 0, sortExpression, prefetchPath, excludedIncludedFields, pageNumber, pageSize); } return(entities); }
protected void ExpectGetDbCount(int countToExpect) { Expect.Call(_dataAccessAdapter.GetDbCount((IEntityFields2)null, null)).IgnoreArguments() .Return(countToExpect); }