// PostgreSQL COUNT() always returns bigint, so we need to downcast to int // TODO: Translate Count with predicate for GroupBy (see base implementation) public override SqlExpression TranslateCount(Expression expression = null) { if (expression != null) { // TODO: Translate Count with predicate for GroupBy return(null); } return(_sqlExpressionFactory.Convert( _sqlExpressionFactory.ApplyDefaultTypeMapping( _sqlExpressionFactory.Function("COUNT", new[] { _sqlExpressionFactory.Fragment("*") }, typeof(long))), typeof(int), _sqlExpressionFactory.FindMapping(typeof(int)))); }
// PostgreSQL COUNT() always returns bigint, so we need to downcast to int // TODO: Translate Count with predicate for GroupBy (see base implementation) public override SqlExpression TranslateCount(Expression expression = null) => _sqlExpressionFactory.Convert( _sqlExpressionFactory.ApplyDefaultTypeMapping( _sqlExpressionFactory.Function("COUNT", new[] { _sqlExpressionFactory.Fragment("*") }, typeof(long))), typeof(int), _sqlExpressionFactory.FindMapping(typeof(int)));