mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 增加 ISelect Aggregate(lambda, out var result) 方法;
This commit is contained in:
@ -812,6 +812,10 @@ namespace FreeSql.Tests.Dameng
|
||||
public void ToAggregate()
|
||||
{
|
||||
var sql = select.ToAggregate(a => new { sum = a.Sum(a.Key.Id + 11.11), avg = a.Avg(a.Key.Id), count = a.Count(), max = a.Max(a.Key.Id), min = a.Min(a.Key.Id) });
|
||||
|
||||
select
|
||||
.Aggregate(a => new { sum = a.Sum(a.Key.Id), count = a.Count() }, out var output)
|
||||
.ToList();
|
||||
}
|
||||
[Fact]
|
||||
public void OrderBy()
|
||||
|
@ -231,8 +231,6 @@ namespace FreeSql.Tests
|
||||
Id = a.Key,
|
||||
EdiId1 = SqlExt.Max(a.Key).Over().PartitionBy(new { a.Value.EdiId, a.Value.Id }).OrderByDescending(new { a.Value.EdiId, a.Value.Id }).ToValue(),
|
||||
EdiId2 = SqlExt.Max(a.Key).Over().PartitionBy(a.Value.EdiId).OrderByDescending(a.Value.Id).ToValue(),
|
||||
|
||||
Sub1 = g.sqlserver.Select<Edi>().Where(b => b.Id == a.Key).Count()
|
||||
});
|
||||
|
||||
var sqlextGroupConcat = g.mysql.Select<Edi, EdiItem>()
|
||||
|
Reference in New Issue
Block a user