PoC for EF Core 5 (and may be 3.1) support - #2179
Conversation
the description and the QueryFilter itself.
the EntityId. The response code is not set properly until after ExecuteResultAsync() is completed.
key is not present in the SerializableError. Convert the errors in SerializableError into ODataErrorDetail collection.
…bound is either ODataQueryOptions or ODataQueryOptions<T>.
if a filter of the same type is already present in the Filters list. Modify QueryFilterProvider to apply of a global query filter if the return type is a Task<> returning a collection and if the return type is derived from single result.
…ataPathRouteConstraintTest. RFC3986 specifies "[" and "]" and gen-delims in BNF notation in section 2.2 but section 3.2.2 specifies that the are only valid in a Uri as part of an IPV6 host. Therefore, they are not valid in any part of a Uri, which is how the tests use _stringsLegalEverywhere.
…rate is:
AspNet : 4648 pass, 0 fail - 100% enabled, 100% pass
AspNetCore: 4424 pass, 0 fail - 95% enabled, 100% pass
This change:
1.) Fixes DelayLoadFilterProvider so it works.
2.) Adds coreBuilder.AddDataAnnotations() to enable DataAnnotation validation.
3.) Makes the default action "Get"
4.) Makes Created() and BadRequest() return action results.
5.) Includes route name in GetServiceRootUri()
6.) Fixes LowerCamelCaseTest to expect BadResult() now that ODataQueryOptions skips parameter validation.
7.) Disables CRUDEntitySetShouldWork() since unicode values in headers are not supported in Kestrel.
8.) Modifies IsofFunctionTests to expect an HttpRequestException since an error occurs during formatting
after headers has been sent and AspNetCore returns HttpRequestException in this case.
9.) Modifies ODataValueProviderTests to inject an Id instead of an object due to AspNetCore parameter
handle; this also work in AspNet.
10.) Fixes tests in DeltaOfTValidationTests, ComplextTypeCollectionTests, JsonSingleResultExpandTests,
ODataQueryOptionsTests, QueryFuzzingTests, ValidatorTests, and DeltaOfTValidationTests
11.) Enables tests in ContainmentTests, DeltaTests, SecurityTests, PropertyTestsUsingConventionModelBuilder,
CustomFilterValidator, AddRelatedObjectTests, SingletonTests
…es in CollectionTest.cs pass
into account parameters types the bind using custom binders.
1.) Modify Match_ReturnsTrue_IfODataPathCanBeParsed to handle platform-specific differences
in route constraint.
2.) Test ODataRoute without comparing to HttpRoute due to platform differences in HttpRoute.
3.) Modify EntityTypeFunction to return error based on ModelState instead of relying on
exception handling which is platform dependant.
…erty (OData#2160) * Fix logic for patching entity with complex type dynamic property * Support patching of complex type dynamic property in a structured type plus tests * Use string.IsNullOrWhiteSpace Co-authored-by: John Gathogo <jogathog@microsoft.com>
…h PathBase setting
Yes, that is true. EF Core at present only expands navigations upto KeySelector or whatever is in GroupBy call. Any navigation used further is not expanded yet. (difficulty is that navigation needs to be expanded before applying GroupBy even in expression tree). Work-around would be to expand the navigation before calling GroupBy manually. |
That helped. We already had flattening to solve some EF6 issues. I extended it for that case too I replaced by It's solved almost all test. I'm seeing an issue with implementing count distinct. Linq looks like: Exception is: Is it something that I could do to solve that. |
|
@kosinsky - That would be being tracked by dotnet/efcore#17376 |
|
That helped and I managed to make all tests green. However, I noticed that we had no test coverage EF Core for aggregation on nested collections. We are generating something like: and getting exception: Is |
|
That is nested GroupBy. Even if inner GroupBy can be translated, outer GroupBy may not work since outer GroupBy results are still in the form of |
|
Are there any plans to merge this? I've tested the old 7.4.1 nightly build that includes this, and it fixed the problem I'm having. |
Unfortunately, I'm not working on projects that involve OData and don't have spare cycles to continue that work. If you wold like to fork that PR and continue the work, please do. |
4c43a84 to
ddfd3dd
Compare
Trying to solve $apply for EF Core 5 (and 3.1 if possible).
I've updated EF Core to 5 Preview 4 in .NET 3 E2E test it caused. After that 2 x (26 of 34) started to fail
Most of that was caused by casting to IEnumerable in expressions like
Exception:
I think that was attempt to use client eval.
I modified optimization made for EF 2.2 (47756e0) and changed expression to
After that change only 9 tests are failing.
All failing tests are using navigation properties in following way:
$apply=aggregate(Order/Price with sum as Result)that translates to following Linq expression:that causes following error:
Looks like EF has a problem to deal with
$it => $it.Order.Pricecc @xuzhg @smitpatel