DbExpressions.DbSelectQueryExtensions.Having C# (CSharp) Method

Having() public static method

Specifies a search condition for a group or an aggregate.
public static Having ( this dbSelectQuery, DbExpression>.Func expressionSelector ) : DbQuery
dbSelectQuery this The target .
expressionSelector DbExpression>.Func A function used to specify the 'HAVING' expression.
return DbQuery
        public static DbQuery<DbSelectExpression> Having(this DbQuery<DbSelectExpression> dbSelectQuery, Func<DbExpressionFactory, DbExpression> expressionSelector)
        {
            var dbExpression = expressionSelector(DbExpressionFactory);
            if (!dbSelectQuery.QueryExpression.HavingExpression.IsNull())
                dbExpression = DbExpressionFactory.List(new[] { dbSelectQuery.QueryExpression.FromExpression, dbExpression });
            dbSelectQuery.QueryExpression.HavingExpression = dbExpression;
            return dbSelectQuery;
        }