示例#1
0
 // 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)));