-
Notifications
You must be signed in to change notification settings - Fork 474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #2737: Support getting navigation source for complex types #2744
Conversation
…ies on complex types
Any update on this? Would be great it if can get into the next release! |
…igation property bindings. Added tests for above
...crosoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceDeserializerTests.cs
Outdated
Show resolved
Hide resolved
IEdmEntityTypeReference supplierTypeReference = _edmModel.GetEdmTypeReference(typeof(Supplier)).AsEntity(); | ||
IEdmStructuralProperty addressProperty = supplierTypeReference.FindProperty("Address") as IEdmStructuralProperty; | ||
IEdmComplexTypeReference addressTypeReference = _edmModel.GetEdmTypeReference(typeof(Address)).AsComplex(); | ||
IEdmNavigationProperty suppliersProperty = addressTypeReference.FindNavigationProperty("UnboundSuppliers"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
naming the property name as "Unbound...." looks confusing.
...crosoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceDeserializerTests.cs
Outdated
Show resolved
Hide resolved
Assert.Equal(expectedPreferredOdataPath.ToString(), preferredProductsNestedContext.Path.ToString()); | ||
} | ||
|
||
[Fact(Skip = "Bindings ending in cast segments not fully supported yet.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have a corresponding issue created in odata repo?
@@ -110,6 +109,44 @@ internal static ODataDeserializerContext GenerateNestedReadContext(ODataNestedRe | |||
return BuildNestedContextFromCurrentContext(readContext, path); | |||
} | |||
|
|||
// Determines the binding path for an OData Path to a given navigationProperty | |||
private static IEdmPathExpression GetBindingPath(Routing.ODataPath path, IEdmNavigationProperty navigationProperty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like it could be extension method for ODataPath and move it to ODataPathExtensions?
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
Issues
This pull request fixes #2737
Description
New code for keeping accurate path for deserialization context assumed navigation property was on entity.
Checklist (Uncheck if it is not completed)
Additional work necessary
Could use more tests: