Skip to content

Commit 2dfb735

Browse files
Prevent unwanted GroupBy call for GroupSummary without Group (#432)
1 parent 53cdb65 commit 2dfb735

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

net/DevExtreme.AspNet.Data.Tests/RemoteGroupingTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,20 @@ public void GroupSummaryAndTotalCount() {
177177
Assert.Equal(2, result.totalCount);
178178
}
179179

180+
[Fact]
181+
public void GroupSummary_NoGroups() {
182+
var loadOptions = new SampleLoadOptions {
183+
RemoteGrouping = true,
184+
GroupSummary = new[] {
185+
new SummaryInfo { Selector = "any" }
186+
}
187+
};
188+
189+
DataSourceLoader.Load(new object[0], loadOptions);
190+
191+
Assert.DoesNotContain(loadOptions.ExpressionLog, line => line.Contains("GroupBy"));
192+
}
193+
180194
[Fact]
181195
public void NotUsedIfTotalCountOnly() {
182196
var data = new[] {

net/DevExtreme.AspNet.Data/DataSourceLoadContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ partial class DataSourceLoadContext {
232232

233233
public bool HasTotalSummary => !IsEmpty(TotalSummary);
234234

235-
public bool HasGroupSummary => !IsEmpty(GroupSummary);
235+
public bool HasGroupSummary => HasGroups && !IsEmpty(GroupSummary);
236236

237237
public bool SummaryIsTotalCountOnly {
238238
get {

0 commit comments

Comments
 (0)