Skip to content

Commit 53cdb65

Browse files
Use GroupBy(obj => const) for MongoDB (#433)
1 parent 4cfd796 commit 53cdb65

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

net/DevExtreme.AspNet.Data/DataSourceLoadContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public bool RequireQueryableChainBreak {
4444
}
4545

4646
public AnonTypeNewTweaks CreateAnonTypeNewTweaks() => new AnonTypeNewTweaks {
47-
AllowEmpty = !_providerInfo.IsL2S,
47+
AllowEmpty = !_providerInfo.IsL2S && !_providerInfo.IsMongoDB,
4848
AllowUnusedMembers = !_providerInfo.IsL2S
4949
};
5050

net/DevExtreme.AspNet.Data/QueryProviderInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class QueryProviderInfo {
1010
public readonly bool IsXPO;
1111
public readonly bool IsNH;
1212
public readonly bool IsL2S;
13+
public readonly bool IsMongoDB;
1314
public readonly Version Version;
1415

1516
public QueryProviderInfo(IQueryProvider provider) {
@@ -29,6 +30,8 @@ public QueryProviderInfo(IQueryProvider provider) {
2930
IsNH = true;
3031
else if(typeName.StartsWith("System.Data.Linq."))
3132
IsL2S = true;
33+
else if(typeName.StartsWith("MongoDB.Driver.Linq."))
34+
IsMongoDB = true;
3235

3336
Version = type.Assembly.GetName().Version;
3437
}

0 commit comments

Comments
 (0)