Hi There
The getdbcount method gives diffrent count . I am getting something else wthi the collection count for e.g. dbcount gives 14 while there is originallly 9 records inthe collection here is my code
ClientCollection oClientCollection = new ClientCollection();
RelationCollection oRelationCollection = new RelationCollection();
IPredicateExpression filter = new PredicateExpression();
filter.Add(ClientRatingFields.RatedByClientId == clientId);
if (rating != null)
{
filter.AddWithAnd(ClientRatingFields.Rating == rating);
}
IPrefetchPath oPrefatchPath = new PrefetchPath(EntityType.ClientEntity);
IPredicateExpression filterForClientRatings = new PredicateExpression();
filterForClientRatings.Add(ClientRatingFields.RatedByClientId == clientId);
relations.Add(ClientEntity.Relations.ClientRatingEntityUsingRatedClientId, JoinHint.Left);
oPrefatchPath.Add(ClientEntity.PrefetchPathClientRatings_, 0, filterForClientRatings);
IPredicateExpression filterForClientFavourite = new PredicateExpression();
filterForClientFavourite.Add(ClientFavoriteFields.ClientId == clientId);
relations.Add(ClientEntity.Relations.ClientFavoriteEntityUsingFavoriteClientId, JoinHint.Left);
oPrefatchPath.Add(ClientEntity.PrefetchPathClientFavorites_, 0, filterForClientFavourite);
oRelationCollection.Add(ClientEntity.Relations.SearchBlackListEntityUsingBlackListedClientId, JoinHint.Left);
IPredicateExpression oPredicateExpress = new PredicateExpression();
oPredicateExpress.Add(SearchBlackListFields.BlackListedByClientId == clientId);
oPrefatchPath.Add(ClientEntity.PrefetchPathSearchBlackLists_, 0, oPredicateExpress);
IPredicateExpression oPredicateExpression = new PredicateExpression();
oPredicateExpression.Add(new FieldCompareSetPredicate(ClientFields.ClientId, ClientRatingFields.RatedClientId, SetOperator.In, filter, false));
oPredicateExpression.Add(ClientFields.IsActive != false);
oPredicateExpression.AddWithAnd(ClientFields.IsDeleted != true);
ISortExpression oSortExpresssion = new SortExpression();
oSortExpresssion.Add(ClientFields.FirstName | SortOperator.Ascending);
oSortExpresssion.Add(ClientFields.ClientId | SortOperator.Ascending);
GetSortExpressionForClientRating(sortOrder, oSortExpresssion);
totalRated = oClientCollection.GetDbCount(oPredicateExpression, oRelationCollection);
oClientCollection.GetMulti(oPredicateExpression, 0, oSortExpresssion, oRelationCollection, oPrefatchPath, pageNumber, pageSize);
here above totalRated differs with the collections count ( if query fired without any paging)
I am unable to get what's wrong with it.