Interface ISelectGrouping<TKey, TValue>
Assembly: FreeSql.dll
Syntax
public interface ISelectGrouping<TKey, TValue>
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
Methods
|
Improve this Doc
View Source
Count()
Declaration
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
Count(out Int64)
Declaration
ISelectGrouping<TKey, TValue> Count(out long count)
Parameters
Type |
Name |
Description |
System.Int64 |
count |
返回的变量
|
Returns
|
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 Parameters
|
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
|
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
|
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
|
Improve this Doc
View Source
Limit(Int32)
Declaration
ISelectGrouping<TKey, TValue> Limit(int limit)
Parameters
Type |
Name |
Description |
System.Int32 |
limit |
|
Returns
|
Improve this Doc
View Source
Offset(Int32)
Declaration
ISelectGrouping<TKey, TValue> Offset(int offset)
Parameters
Type |
Name |
Description |
System.Int32 |
offset |
行数
|
Returns
|
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 Parameters
|
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 Parameters
|
Improve this Doc
View Source
Page(BasePagingInfo)
Declaration
ISelectGrouping<TKey, TValue> Page(BasePagingInfo pagingInfo)
Parameters
Returns
|
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
|
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
|
Improve this Doc
View Source
Skip(Int32)
Declaration
ISelectGrouping<TKey, TValue> Skip(int offset)
Parameters
Type |
Name |
Description |
System.Int32 |
offset |
|
Returns
|
Improve this Doc
View Source
Take(Int32)
Declaration
ISelectGrouping<TKey, TValue> Take(int limit)
Parameters
Type |
Name |
Description |
System.Int32 |
limit |
|
Returns
|
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
|
Improve this Doc
View Source
ToSql(String)
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)
Declaration
string ToSql<TReturn>(Expression<Func<ISelectGroupingAggregate<TKey, TValue>, TReturn>> select, FieldAliasOptions fieldAlias = FieldAliasOptions.AsIndex)
Parameters
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 Parameters