Search Results for

    Show / Hide Table of Contents

    Interface ISelectGrouping<TKey, TValue>

    Namespace: FreeSql
    Assembly: FreeSql.dll
    Syntax
    public interface ISelectGrouping<TKey, TValue>
    Type Parameters
    Name Description
    TKey
    TValue

    Methods

    | Improve this Doc View Source

    Count()

    查询的记录数量

    Declaration
    long Count()
    Returns
    Type Description
    System.Int64
    | Improve this Doc View Source

    Count(out Int64)

    查询的记录数量,以参数out形式返回

    Declaration
    ISelectGrouping<TKey, TValue> Count(out long count)
    Parameters
    Type Name Description
    System.Int64 count

    返回的变量

    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    CountAsync(CancellationToken)

    Declaration
    Task<long> CountAsync(CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Int64>
    | Improve this Doc View Source

    First<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>>)

    执行SQL查询,返回指定字段的记录的第一条记录,记录不存在时返回 TReturn 默认值

    Declaration
    TReturn First<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select
    Returns
    Type Description
    TReturn
    Type Parameters
    Name Description
    TReturn
    | Improve this Doc View Source

    FirstAsync<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>>, CancellationToken)

    Declaration
    Task<TReturn> FirstAsync<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task<TReturn>
    Type Parameters
    Name Description
    TReturn
    | Improve this Doc View Source

    Having(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, Boolean>>)

    按聚合条件过滤,Having(a => a.Count() > 10)

    Declaration
    ISelectGrouping<TKey, TValue> Having(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, bool>> exp)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, System.Boolean>> exp

    lambda表达式

    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    HavingIf(Boolean, Expression<Func<ISelectGroupingAggregate<TKey, TValue>, Boolean>>)

    按聚合条件过滤,HavingIf(true, a => a.Count() > 10)

    Declaration
    ISelectGrouping<TKey, TValue> HavingIf(bool condition, Expression<Func<ISelectGroupingAggregate<TKey, TValue>, bool>> exp)
    Parameters
    Type Name Description
    System.Boolean condition

    true 时生效

    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, System.Boolean>> exp

    lambda表达式

    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    Limit(Int32)

    查询多少条数据

    Declaration
    ISelectGrouping<TKey, TValue> Limit(int limit)
    Parameters
    Type Name Description
    System.Int32 limit
    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    Offset(Int32)

    查询向后偏移行数

    Declaration
    ISelectGrouping<TKey, TValue> Offset(int offset)
    Parameters
    Type Name Description
    System.Int32 offset

    行数

    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    OrderBy<TMember>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TMember>>)

    按列排序,OrderBy(a => a.Time)

    Declaration
    ISelectGrouping<TKey, TValue> OrderBy<TMember>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TMember>> column)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TMember>> column
    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    Type Parameters
    Name Description
    TMember
    | Improve this Doc View Source

    OrderByDescending<TMember>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TMember>>)

    按列倒向排序,OrderByDescending(a => a.Time)

    Declaration
    ISelectGrouping<TKey, TValue> OrderByDescending<TMember>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TMember>> column)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TMember>> column

    列

    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    Type Parameters
    Name Description
    TMember
    | Improve this Doc View Source

    Page(BasePagingInfo)

    分页

    Declaration
    ISelectGrouping<TKey, TValue> Page(BasePagingInfo pagingInfo)
    Parameters
    Type Name Description
    BasePagingInfo pagingInfo

    分页信息

    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    Page(Int32, Int32)

    分页

    Declaration
    ISelectGrouping<TKey, TValue> Page(int pageNumber, int pageSize)
    Parameters
    Type Name Description
    System.Int32 pageNumber

    第几页

    System.Int32 pageSize

    每页多少

    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    Select<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>>)

    【linq to sql】专用方法,不建议直接使用

    Declaration
    List<TReturn> Select<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select
    Returns
    Type Description
    System.Collections.Generic.List<TReturn>
    Type Parameters
    Name Description
    TReturn
    | Improve this Doc View Source

    Skip(Int32)

    查询向后偏移行数

    Declaration
    ISelectGrouping<TKey, TValue> Skip(int offset)
    Parameters
    Type Name Description
    System.Int32 offset
    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    Take(Int32)

    查询多少条数据

    Declaration
    ISelectGrouping<TKey, TValue> Take(int limit)
    Parameters
    Type Name Description
    System.Int32 limit
    Returns
    Type Description
    ISelectGrouping<TKey, TValue>
    | Improve this Doc View Source

    ToDictionary<TElement>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TElement>>)

    Declaration
    Dictionary<TKey, TElement> ToDictionary<TElement>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TElement>> elementSelector)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TElement>> elementSelector
    Returns
    Type Description
    System.Collections.Generic.Dictionary<TKey, TElement>
    Type Parameters
    Name Description
    TElement
    | Improve this Doc View Source

    ToDictionaryAsync<TElement>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TElement>>, CancellationToken)

    Declaration
    Task<Dictionary<TKey, TElement>> ToDictionaryAsync<TElement>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TElement>> elementSelector, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TElement>> elementSelector
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<TKey, TElement>>
    Type Parameters
    Name Description
    TElement
    | Improve this Doc View Source

    ToList<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>>)

    执行SQL查询,返回指定字段的记录,记录不存在时返回 Count 为 0 的列表

    Declaration
    List<TReturn> ToList<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select

    选择列

    Returns
    Type Description
    System.Collections.Generic.List<TReturn>
    Type Parameters
    Name Description
    TReturn

    返回类型

    | Improve this Doc View Source

    ToListAsync<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>>, CancellationToken)

    Declaration
    Task<List<TReturn>> ToListAsync<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select, CancellationToken cancellationToken = default(CancellationToken))
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select
    System.Threading.CancellationToken cancellationToken
    Returns
    Type Description
    System.Threading.Tasks.Task<System.Collections.Generic.List<TReturn>>
    Type Parameters
    Name Description
    TReturn
    | Improve this Doc View Source

    ToSql(String)

    返回即将执行的SQL语句

    Declaration
    string ToSql(string field)
    Parameters
    Type Name Description
    System.String field

    指定字段

    Returns
    Type Description
    System.String
    | Improve this Doc View Source

    ToSql<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>>, FieldAliasOptions)

    返回即将执行的SQL语句

    Declaration
    string ToSql<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select

    选择列

    FieldAliasOptions fieldAlias
    Returns
    Type Description
    System.String
    Type Parameters
    Name Description
    TReturn

    返回类型

    | Improve this Doc View Source

    WithTempQuery<TDto>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TDto>>)

    嵌套查询 select * from ( select ... from table group by ... ) a

    Declaration
    ISelect<TDto> WithTempQuery<TDto>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TDto>> selector)
    Parameters
    Type Name Description
    System.Linq.Expressions.Expression<System.Func<ISelectGroupingAggregate<TKey, TValue>, TDto>> selector
    Returns
    Type Description
    ISelect<TDto>
    Type Parameters
    Name Description
    TDto
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX