Path: redb/redb.Core/Query/Grouping/GroupedWindowSpec.cs
Snapshot: redb, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb
Page: https://redbase.app/src/dev-2026-12-06/redb/redb.Core/Query/Grouping/GroupedWindowSpec.cs
----
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using redb.Core.Models.Contracts;
namespace redb.Core.Query.Grouping;
///
/// Window specification for grouped queries.
///
public class GroupedWindowSpec : IGroupedWindowSpec
{
internal List PartitionByExpressions { get; } = [];
internal List<(LambdaExpression Expression, bool Descending)> OrderByExpressions { get; } = [];
public IGroupedWindowSpec PartitionBy(
Expression> keySelector)
{
PartitionByExpressions.Add(keySelector);
return this;
}
public IGroupedWindowSpec OrderBy(
Expression, TField>> orderSelector)
{
OrderByExpressions.Add((orderSelector, false));
return this;
}
public IGroupedWindowSpec OrderByDesc(
Expression, TField>> orderSelector)
{
OrderByExpressions.Add((orderSelector, true));
return this;
}
}