diff --git a/.editorconfig b/.editorconfig index 5a90655fa16..aa151b986e4 100644 --- a/.editorconfig +++ b/.editorconfig @@ -281,3 +281,6 @@ dotnet_naming_rule.everything_else_naming.severity = suggestion # ReSharper properties resharper_local_function_body = expression_body + +# CS9236: Compiling requires binding the lambda expression at least 100 times +dotnet_diagnostic.CS9236.severity = error diff --git a/test/EFCore.Specification.Tests/Query/ComplexNavigationsQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/ComplexNavigationsQueryTestBase.cs index a9eb2f70f43..7bdf2d95a83 100644 --- a/test/EFCore.Specification.Tests/Query/ComplexNavigationsQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/ComplexNavigationsQueryTestBase.cs @@ -2941,20 +2941,23 @@ public virtual async Task Member_pushdown_chain_3_levels_deep(bool async) { using var ctx = CreateContext(); - var query = from l1 in ctx.LevelOne - orderby l1.Id - where (from l2 in ctx.LevelTwo - orderby l2.Id - where l2.Level1_Optional_Id == l1.Id - select (from l3 in ctx.LevelThree - orderby l3.Id - where l3.Level2_Required_Id == l2.Id - select (from l4 in ctx.LevelFour - where l4.Level3_Required_Id == l3.Id - orderby l4.Id - select l4).FirstOrDefault()).FirstOrDefault()).FirstOrDefault().Name - != "Foo" - select l1; +#pragma warning disable CS9236 // Compiling requires binding the lambda expression at least 200 times + var query = ctx.LevelOne + .OrderBy(l1 => l1.Id) + .Where(l1 => ctx.LevelTwo + .OrderBy(l2 => l2.Id) + .Where(l2 => l2.Level1_Optional_Id == l1.Id) + .Select(l2 => ctx.LevelThree + .OrderBy(l3 => l3.Id) + .Where(l3 => l3.Level2_Required_Id == l2.Id) + .Select(l3 => ctx.LevelFour + .Where(bool (Level4 l4) => l4.Level3_Required_Id == l3.Id) + .OrderBy(int (Level4 l4) => l4.Id) + .FirstOrDefault()) + .FirstOrDefault()) + .FirstOrDefault() + .Name != "Foo"); +#pragma warning restore CS9236 _ = async ? await query.ToListAsync() : query.ToList(); } @@ -2965,18 +2968,20 @@ public virtual async Task Member_pushdown_chain_3_levels_deep_entity(bool async) { using var ctx = CreateContext(); - var query = from l1 in ctx.LevelOne - orderby l1.Id - select (from l2 in ctx.LevelTwo - orderby l2.Id - where l2.Level1_Optional_Id == l1.Id - select (from l3 in ctx.LevelThree - orderby l3.Id - where l3.Level2_Required_Id == l2.Id - select (from l4 in ctx.LevelFour - where l4.Level3_Required_Id == l3.Id - orderby l4.Id - select l4).FirstOrDefault()).FirstOrDefault()).FirstOrDefault(); + var query = ctx.LevelOne + .OrderBy(l1 => l1.Id) + .Select(l1 => ctx.LevelTwo + .OrderBy(l2 => l2.Id) + .Where(l2 => l2.Level1_Optional_Id == l1.Id) + .Select(l2 => ctx.LevelThree + .OrderBy(l3 => l3.Id) + .Where(l3 => l3.Level2_Required_Id == l2.Id) + .Select(l3 => ctx.LevelFour + .Where(bool (Level4 l4) => l4.Level3_Required_Id == l3.Id) + .OrderBy(int (Level4 l4) => l4.Id) + .FirstOrDefault()) + .FirstOrDefault()) + .FirstOrDefault()); _ = async ? await query.ToListAsync() : query.ToList(); } @@ -4052,7 +4057,7 @@ public virtual Task Max_in_multi_level_nested_subquery(bool async) LevelFour = new { xx.OneToOne_Required_FK2.OneToOne_Required_FK3.Id, - Result = (xx.OneToOne_Required_FK2.OneToMany_Optional3.Max(xxx => (int?)xxx.Id) ?? 0) + Result = (xx.OneToOne_Required_FK2.OneToMany_Optional3.Max(int? (Level4 xxx) => (int?)xxx.Id) ?? 0) > 1 } } diff --git a/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs b/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs index a99473864a6..2c3c27e01d8 100644 --- a/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/Ef6GroupByTestBase.cs @@ -360,7 +360,7 @@ public virtual Task Min_Elements_from_LINQ_101(bool async) ss => from p in ss.Set() group p by p.Category into g - let minPrice = g.Min(p => p.UnitPrice) + let minPrice = g.Min(decimal (ProductForLinq p) => p.UnitPrice) select new { Category = g.Key, CheapestProducts = g.Where(p => p.UnitPrice == minPrice) })); [ConditionalTheory] @@ -383,7 +383,7 @@ public virtual Task Max_Elements_from_LINQ_101(bool async) ss => from p in ss.Set() group p by p.Category into g - let minPrice = g.Max(p => p.UnitPrice) + let minPrice = g.Max(decimal (ProductForLinq p) => p.UnitPrice) select new { Category = g.Key, MostExpensiveProducts = g.Where(p => p.UnitPrice == minPrice) })); [ConditionalTheory] diff --git a/test/EFCore.Specification.Tests/Query/NorthwindAggregateOperatorsQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindAggregateOperatorsQueryTestBase.cs index 2a557a26d1f..7dd82e85d64 100644 --- a/test/EFCore.Specification.Tests/Query/NorthwindAggregateOperatorsQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/NorthwindAggregateOperatorsQueryTestBase.cs @@ -139,7 +139,7 @@ public virtual Task Sum_over_subquery(bool async) => AssertSum( async, ss => ss.Set(), - selector: c => c.Orders.Sum(o => o.OrderID)); + selector: c => c.Orders.Sum(int (Order o) => o.OrderID)); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -147,7 +147,7 @@ public virtual Task Sum_over_nested_subquery(bool async) => AssertSum( async, ss => ss.Set(), - selector: c => c.Orders.Sum(o => 5 + o.OrderDetails.Sum(od => od.ProductID))); + selector: c => c.Orders.Sum(int (Order o) => 5 + o.OrderDetails.Sum(int (OrderDetail od) => od.ProductID))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -155,7 +155,7 @@ public virtual Task Sum_over_min_subquery(bool async) => AssertSum( async, ss => ss.Set(), - selector: c => c.Orders.Sum(o => 5 + o.OrderDetails.Min(od => od.ProductID))); + selector: c => c.Orders.Sum(int (Order o) => 5 + o.OrderDetails.Min(int (OrderDetail od) => od.ProductID))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -270,7 +270,7 @@ public virtual Task Average_over_subquery(bool async) => AssertAverage( async, ss => ss.Set(), - selector: c => c.Orders.Sum(o => o.OrderID)); + selector: c => c.Orders.Sum(int (Order o) => o.OrderID)); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -278,7 +278,7 @@ public virtual Task Average_over_nested_subquery(bool async) => AssertAverage( async, ss => ss.Set().OrderBy(c => c.CustomerID).Take(3), - selector: c => (decimal)c.Orders.Average(o => 5 + o.OrderDetails.Average(od => od.ProductID))); + selector: c => (decimal)c.Orders.Average(double (Order o) => 5 + o.OrderDetails.Average(int (OrderDetail od) => od.ProductID))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -286,7 +286,7 @@ public virtual Task Average_over_max_subquery(bool async) => AssertAverage( async, ss => ss.Set().OrderBy(c => c.CustomerID).Take(3), - selector: c => (decimal)c.Orders.Average(o => 5 + o.OrderDetails.Max(od => od.ProductID))); + selector: c => (decimal)c.Orders.Average(int (Order o) => 5 + o.OrderDetails.Max(int (OrderDetail od) => od.ProductID))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -447,7 +447,7 @@ public virtual Task Min_over_nested_subquery(bool async) => AssertMin( async, ss => ss.Set().OrderBy(c => c.CustomerID).Take(3), - selector: c => c.Orders.Min(o => 5 + Enumerable.Min(o.OrderDetails, od => od.ProductID))); + selector: c => c.Orders.Min(o => 5 + Enumerable.Min(o.OrderDetails, int (OrderDetail od) => od.ProductID))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -455,7 +455,7 @@ public virtual Task Min_over_max_subquery(bool async) => AssertMin( async, ss => ss.Set().OrderBy(c => c.CustomerID).Take(3), - selector: c => c.Orders.Min(o => 5 + o.OrderDetails.Max(od => od.ProductID))); + selector: c => c.Orders.Min(o => 5 + o.OrderDetails.Max(int (OrderDetail od) => od.ProductID))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -494,7 +494,7 @@ public virtual Task Max_over_nested_subquery(bool async) => AssertMax( async, ss => ss.Set().OrderBy(c => c.CustomerID).Take(3), - selector: c => c.Orders.Max(o => 5 + Enumerable.Max(o.OrderDetails, od => od.ProductID))); + selector: c => c.Orders.Max(o => 5 + Enumerable.Max(o.OrderDetails, int (OrderDetail od) => od.ProductID))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -502,7 +502,7 @@ public virtual Task Max_over_sum_subquery(bool async) => AssertMax( async, ss => ss.Set().OrderBy(c => c.CustomerID).Take(3), - selector: c => c.Orders.Max(o => 5 + o.OrderDetails.Sum(od => od.ProductID))); + selector: c => c.Orders.Max(o => 5 + o.OrderDetails.Sum(int (od) => od.ProductID))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] diff --git a/test/EFCore.Specification.Tests/Query/NorthwindGroupByQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindGroupByQueryTestBase.cs index ee4db2c2cbd..49a30ad2bb0 100644 --- a/test/EFCore.Specification.Tests/Query/NorthwindGroupByQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/NorthwindGroupByQueryTestBase.cs @@ -37,7 +37,7 @@ public virtual Task GroupBy_Property_Select_Average_with_group_enumerable_projec async, ss => ss.Set().Where(o => o.Customer.City != "London") .GroupBy(o => o.CustomerID, (k, es) => new { k, es }) - .Select(g => g.es.Average(o => o.OrderID)))); + .Select(g => g.es.Average(int (Order o) => o.OrderID)))); [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -1580,7 +1580,7 @@ into g { s.Month, s.Total, - Payment = ss.Set().Where(e => e.OrderDate.Value.Month == s.Month).Sum(e => e.OrderID) + Payment = ss.Set().Where(e => e.OrderDate.Value.Month == s.Month).Sum(int (Order e) => e.OrderID) }, elementSorter: e => (e.Month, e.Total), elementAsserter: (e, a) => @@ -1775,7 +1775,7 @@ public virtual Task GroupBy_Aggregate_Join_converted_from_SelectMany(bool async) ss => from c in ss.Set() from o in ss.Set().GroupBy(o => o.CustomerID) .Where(g => g.Count() > 5) - .Select(g => new { CustomerID = g.Key, LastOrderID = g.Max(o => o.OrderID) }) + .Select(g => new { CustomerID = g.Key, LastOrderID = g.Max(int (Order o) => o.OrderID) }) .Where(c1 => c.CustomerID == c1.CustomerID) select c); @@ -1787,7 +1787,7 @@ public virtual Task GroupBy_Aggregate_LeftJoin_converted_from_SelectMany(bool as ss => from c in ss.Set() from o in ss.Set().GroupBy(o => o.CustomerID) .Where(g => g.Count() > 5) - .Select(g => new { CustomerID = g.Key, LastOrderID = g.Max(o => o.OrderID) }) + .Select(g => new { CustomerID = g.Key, LastOrderID = g.Max(int (Order o) => o.OrderID) }) .Where(c1 => c.CustomerID == c1.CustomerID) .DefaultIfEmpty() select c); @@ -2342,7 +2342,7 @@ from oc1 in ss.Set() .Where(x => x.CustomerID == c.CustomerID).DefaultIfEmpty() group new { c.CustomerID, oc1.Count } by c.CustomerID into g - select new { CustomerID = g.Key, Count = g.Sum(x => x.Count) }).Where(x => x.CustomerID == c1.CustomerID) + select new { CustomerID = g.Key, Count = g.Sum(int? (x) => x.Count) }).Where(x => x.CustomerID == c1.CustomerID) .DefaultIfEmpty() select new { @@ -2357,7 +2357,7 @@ from oc1 in ss.Set() .Where(x => x.CustomerID == c.CustomerID).DefaultIfEmpty() group new { c.CustomerID, Count = oc1.MaybeScalar(e => e.Count) } by c.CustomerID into g - select new { CustomerID = g.Key, Count = g.Sum(x => x.Count) }).Where(x => x.CustomerID == c1.CustomerID) + select new { CustomerID = g.Key, Count = g.Sum(int? (x) => x.Count) }).Where(x => x.CustomerID == c1.CustomerID) .DefaultIfEmpty() select new { @@ -3200,7 +3200,7 @@ public virtual Task Complex_query_with_groupBy_in_subquery1(bool async) Subquery = c.Orders .Select(o => new { First = o.CustomerID, Second = o.OrderID }) .GroupBy(x => x.First) - .Select(g => new { Sum = g.Sum(x => x.Second) }).ToList() + .Select(g => new { Sum = g.Sum(int (x) => x.Second) }).ToList() }), elementSorter: e => e.Key, elementAsserter: (e, a) => @@ -3222,7 +3222,7 @@ public virtual Task Complex_query_with_groupBy_in_subquery2(bool async) Subquery = c.Orders .Select(o => new { First = o.CustomerID, Second = o.OrderID }) .GroupBy(x => x.First) - .Select(g => new { Max = g.Max(x => x.First.Length), Sum = g.Sum(x => x.Second) }).ToList() + .Select(g => new { Max = g.Max(int (x) => x.First.Length), Sum = g.Sum(int (x) => x.Second) }).ToList() }), elementSorter: e => e.Key, elementAsserter: (e, a) => @@ -3244,7 +3244,7 @@ public virtual Task Complex_query_with_groupBy_in_subquery3(bool async) Subquery = ss.Set() .Select(o => new { First = o.CustomerID, Second = o.OrderID }) .GroupBy(x => x.First) - .Select(g => new { Max = g.Max(x => x.First.Length), Sum = g.Sum(x => x.Second) }).ToList() + .Select(g => new { Max = g.Max(int (x) => x.First.Length), Sum = g.Sum(int (x) => x.Second) }).ToList() }), elementSorter: e => e.Key, elementAsserter: (e, a) => @@ -3266,7 +3266,7 @@ public virtual Task Complex_query_with_groupBy_in_subquery4(bool async) Subquery = c.Orders .Select(o => new { First = o.OrderID, Second = o.Customer.City + o.CustomerID }) .GroupBy(x => x.Second) - .Select(g => new { Sum = g.Sum(x => x.First), Count = g.Count(x => x.Second.StartsWith("Lon")) }).ToList() + .Select(g => new { Sum = g.Sum(int (x) => x.First), Count = g.Count(x => x.Second.StartsWith("Lon")) }).ToList() }), elementSorter: e => e.Key, elementAsserter: (e, a) => @@ -3288,7 +3288,7 @@ into grouping { Sum = grouping.Sum(x => x.ProductID + x.OrderID * 1000), Subquery = (from c in ss.Set() - where c.CustomerID.Length < grouping.Min(x => x.OrderID / 100) + where c.CustomerID.Length < grouping.Min(int (OrderDetail x) => x.OrderID / 100) orderby c.CustomerID select new { c.CustomerID, c.City }).ToList() }, @@ -3381,7 +3381,7 @@ public virtual Task GroupBy_aggregate_from_multiple_query_in_same_projection_2(b { g.Key, A = ss.Set().Where(e => e.City == "Seattle").GroupBy(e => e.City) - .Select(g2 => g2.Count() + g.Min(e => e.OrderID)) + .Select(g2 => g2.Count() + g.Min(int (Order e) => e.OrderID)) .OrderBy(e => 1) .FirstOrDefault() }), diff --git a/test/EFCore.Specification.Tests/Query/NorthwindJoinQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindJoinQueryTestBase.cs index af0b2ff3283..7cac68eb4b8 100644 --- a/test/EFCore.Specification.Tests/Query/NorthwindJoinQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/NorthwindJoinQueryTestBase.cs @@ -721,7 +721,7 @@ public virtual Task GroupJoin_aggregate_nested_anonymous_key_selectors(bool asyn ss.Set(), x => new { x.CustomerID, Nested = new { x.City, Year = 1996 } }, x => new { x.CustomerID, Nested = new { City = "London", x.OrderDate.Value.Year } }, - (c, g) => new { c.CustomerID, Sum = g.Sum(x => x.CustomerID.Length) }), + (c, g) => new { c.CustomerID, Sum = g.Sum(int (x) => x.CustomerID.Length) }), elementSorter: e => e.CustomerID)); [ConditionalTheory] diff --git a/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs b/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs index c5891761e2d..98605695814 100644 --- a/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs +++ b/test/EFCore.Specification.Tests/Query/NorthwindMiscellaneousQueryTestBase.cs @@ -1833,6 +1833,7 @@ public virtual Task Where_query_composition3(bool async) where c1.City == ss.Set().OrderBy(c => c.CustomerID).First(c => c.IsLondon).City select c1)); +#pragma warning disable CS9236 // Compiling requires binding the lambda expression at least 200 times [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Where_query_composition4(bool async) @@ -1842,9 +1843,10 @@ public virtual Task Where_query_composition4(bool async) ss => from c1 in ss.Set().OrderBy(c => c.CustomerID).Take(2) where c1.City == (from c2 in ss.Set().OrderBy(c => c.CustomerID) - from c3 in ss.Set().OrderBy(c => c.IsLondon).ThenBy(c => c.CustomerID) + from c3 in ss.Set().OrderBy(bool (Customer c) => c.IsLondon).ThenBy(string (Customer c) => c.CustomerID) select new { c3 }).First().c3.City select c1)); +#pragma warning restore CS9236 [ConditionalTheory] [MemberData(nameof(IsAsyncData))] @@ -3990,6 +3992,7 @@ public virtual Task Complex_query_with_repeated_query_model_compiles_correctly(b where customers.Any() select customers).Any())); +#pragma warning disable CS9236 // Compiling requires binding the lambda expression at least 200 times [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Complex_query_with_repeated_nested_query_model_compiles_correctly(bool async) @@ -4001,10 +4004,11 @@ public virtual Task Complex_query_with_repeated_nested_query_model_compiles_corr outer => (from c in ss.Set() let customers = ss.Set().Where( - cc => ss.Set().OrderBy(inner => inner.CustomerID).Take(10).Distinct().Any()) + cc => ss.Set().OrderBy(string (Customer inner) => inner.CustomerID).Take(10).Distinct().Any()) .Select(cc => cc.CustomerID).ToList() where customers.Any() select customers).Any())); +#pragma warning restore CS9236 [ConditionalTheory] [MemberData(nameof(IsAsyncData))] diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAggregateOperatorsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAggregateOperatorsQuerySqlServerTest.cs index 1211206d00e..03c593b40ae 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAggregateOperatorsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindAggregateOperatorsQuerySqlServerTest.cs @@ -950,7 +950,7 @@ public override async Task Average_over_nested_subquery(bool async) await AssertAverage( async, ss => ss.Set().OrderBy(c => c.CustomerID).Take(3), - selector: c => (decimal)c.Orders.Average(o => 5 + o.OrderDetails.Average(od => od.ProductID)), + selector: c => (decimal)c.Orders.Average(double (Order o) => 5 + o.OrderDetails.Average(int (OrderDetail od) => od.ProductID)), asserter: (e, a) => Assert.Equal(e, a, precision: 3)); // #34256: rewrite query to avoid "Cannot perform an aggregate function on an expression containing an aggregate or a subquery" diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs index 67eb04a3756..f18226dbe72 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NorthwindMiscellaneousQuerySqlServerTest.cs @@ -5844,18 +5844,19 @@ public Task Query_compiler_concurrency() () => { using var context = CreateContext(); - using ((from c in context.Customers - where c.City == "London" - orderby c.CustomerID - select (from o1 in context.Orders - where o1.CustomerID == c.CustomerID - && o1.OrderDate.Value.Year == 1997 - orderby o1.OrderID - select (from o2 in context.Orders - where o1.CustomerID == c.CustomerID - orderby o2.OrderID - select o1.OrderID).ToList()).ToList()) - .GetEnumerator()) + using (context.Customers + .Where(c => c.City == "London") + .OrderBy(c => c.CustomerID) + .Select(c => context.Orders + .Where(o1 => o1.CustomerID == c.CustomerID && o1.OrderDate.Value.Year == 1997) + .OrderBy(o1 => o1.OrderID) + .Select(o1 => context.Orders + .Where(o2 => o1.CustomerID == c.CustomerID) + .OrderBy(o2 => o2.OrderID) + .Select(o2 => o1.OrderID) + .ToList()) + .ToList()) + .GetEnumerator()) { } }); diff --git a/test/EFCore.Sqlite.FunctionalTests/BuiltInDataTypesSqliteTest.cs b/test/EFCore.Sqlite.FunctionalTests/BuiltInDataTypesSqliteTest.cs index 614f53a34cf..36f854632fd 100644 --- a/test/EFCore.Sqlite.FunctionalTests/BuiltInDataTypesSqliteTest.cs +++ b/test/EFCore.Sqlite.FunctionalTests/BuiltInDataTypesSqliteTest.cs @@ -867,17 +867,17 @@ public virtual void Cant_query_Min_of_converted_types() Assert.Equal( SqliteStrings.AggregateOperationNotSupported(nameof(Queryable.Min), typeof(DateTimeOffset).ShortDisplayName()), Assert.Throws( - () => query.Select(g => g.Min(e => e.TestNullableDateTimeOffset)).ToList()).Message); + () => query.Select(g => g.Min(DateTimeOffset? (BuiltInNullableDataTypes e) => e.TestNullableDateTimeOffset)).ToList()).Message); Assert.Equal( SqliteStrings.AggregateOperationNotSupported(nameof(Queryable.Min), typeof(TimeSpan).ShortDisplayName()), Assert.Throws( - () => query.Select(g => g.Min(e => e.TestNullableTimeSpan)).ToList()).Message); + () => query.Select(g => g.Min(TimeSpan? (BuiltInNullableDataTypes e) => e.TestNullableTimeSpan)).ToList()).Message); Assert.Equal( SqliteStrings.AggregateOperationNotSupported(nameof(Queryable.Min), typeof(ulong).ShortDisplayName()), Assert.Throws( - () => query.Select(g => g.Min(e => e.TestNullableUnsignedInt64)).ToList()).Message); + () => query.Select(g => g.Min(ulong? (BuiltInNullableDataTypes e) => e.TestNullableUnsignedInt64)).ToList()).Message); } [ConditionalFact] @@ -917,17 +917,17 @@ public virtual void Cant_query_Max_of_converted_types() Assert.Equal( SqliteStrings.AggregateOperationNotSupported(nameof(Queryable.Max), typeof(DateTimeOffset).ShortDisplayName()), Assert.Throws( - () => query.Select(g => g.Max(e => e.TestNullableDateTimeOffset)).ToList()).Message); + () => query.Select(g => g.Max(DateTimeOffset? (BuiltInNullableDataTypes e) => e.TestNullableDateTimeOffset)).ToList()).Message); Assert.Equal( SqliteStrings.AggregateOperationNotSupported(nameof(Queryable.Max), typeof(TimeSpan).ShortDisplayName()), Assert.Throws( - () => query.Select(g => g.Max(e => e.TestNullableTimeSpan)).ToList()).Message); + () => query.Select(g => g.Max(TimeSpan? (BuiltInNullableDataTypes e) => e.TestNullableTimeSpan)).ToList()).Message); Assert.Equal( SqliteStrings.AggregateOperationNotSupported(nameof(Queryable.Max), typeof(ulong).ShortDisplayName()), Assert.Throws( - () => query.Select(g => g.Max(e => e.TestNullableUnsignedInt64)).ToList()).Message); + () => query.Select(g => g.Max(ulong? (BuiltInNullableDataTypes e) => e.TestNullableUnsignedInt64)).ToList()).Message); } [ConditionalFact]