Hello,
I have encoutered a problem with the FetchScalar<T> method after overriding the FetchProjection method.
FetchScalar<int> started to returning a null value whenever the query returned 0.
When I remove the the line of code where I'm adding the predicate expression (parameters.FilterToUseAsPredicateExpression.Add(field.Equal(1)); ) it works again as it should. The return value is 0.
public override void FetchProjection(List<IDataValueProjector> valueProjectors, IGeneralDataProjector projector, QueryParameters parameters)
{
var field = .....
parameters.FilterToUseAsPredicateExpression.Add(field.Equal(1));
base.FetchProjection(valueProjectors, projector, parameters);
}
And this is how I call the code
int count = _adapter.FetchScalar<int>(query);
Is there something wrong with my code ?