/// <summary> /// This API supports the Entity Framework Core infrastructure and is not intended to be used /// directly from your code. This API may change or be removed in future releases. /// </summary> public override Expression VisitCount(CountExpression countExpression) { Check.NotNull(countExpression, nameof(countExpression)); if (countExpression.Type == typeof(long)) { Sql.Append("COUNT_BIG(*)"); return countExpression; } return base.VisitCount(countExpression); }
public override Expression VisitCount(CountExpression countExpression) { Check.NotNull(countExpression, nameof(countExpression)); if (countExpression.Type == typeof(long)) { Sql.Append("COUNT(*)"); } else if (countExpression.Type == typeof(int)) { Sql.Append("CAST(COUNT(*) AS UNSIGNED)"); } else throw new NotSupportedException($"Count expression with type {countExpression.Type} not supported"); return countExpression; }