Repository navigation
Conversation
| return new UnresolvedNavigationPropertyPath(definingType, binding.Path, binding.Location); | ||
| if (lastNavProp != null && !lastNavProp.ContainsTarget) | ||
| { | ||
| // TODO: Improve error message #644. |
There was a problem hiding this comment.
shall we improve the error message as well?
| Assert.NotNull(navProp); | ||
| Assert.Equal(2, setA.NavigationPropertyBindings.Count()); | ||
|
|
||
| // NavPropBinding for for EntityX1 should be SetX1 |
| Assert.Equal(setX1, X1NavPropBinding.Target); | ||
| Assert.Equal(setX1, setA.FindNavigationTarget(navProp, new EdmPathExpression("Nav/NS.EntityX1"))); | ||
|
|
||
| // NavPropBinding for for EntityX2 should be SetX2 |
| var X1NavPropBinding = setA.NavigationPropertyBindings.FirstOrDefault(b => b.Path.PathSegments.Last() == "NS.EntityX1"); | ||
| Assert.NotNull(X1NavPropBinding); | ||
| var setX1 = model.FindDeclaredNavigationSource("SetX1"); | ||
| Assert.Equal(setX1, X1NavPropBinding.Target); |
There was a problem hiding this comment.
shall we use 'Assert.Same' to make sure they are referencing the same instance? #Resolved
| if (navigationProperty.Name != bindingPath.PathSegments.Last()) | ||
| // Last segment must be the navigation segment or a type cast segment | ||
| string lastSegment = null; | ||
| string penultimateSegment = null; |
# Conflicts: # test/FunctionalTests/Microsoft.OData.Edm.Tests/Microsoft.OData.Edm.Tests.csproj
|
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) |
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
| // Last segment must be the navigation segment or a type cast segment | ||
| string lastSegment = null; | ||
| string penultimateSegment = null; | ||
| foreach (string segment in bindingPath.PathSegments) |
There was a problem hiding this comment.
Cannot use "LastOrDefault()"?
Then check the return is null or not?
| [Theory] | ||
| public void ValidateNavigationPropertyBindingPathEndingInTypeCast(string odataVersion) | ||
| { | ||
| var entitySetWithNavProperties = |
There was a problem hiding this comment.
maybe name it as " entitySetWithNavBindings"
|
" |
||
|
" |
||
| ""; | ||
| var entitySetWithoutNavProperties = |
There was a problem hiding this comment.
maybe name it as " entitySetWithoutNavBindings"
| @@ -81,20 +81,6 @@ | |||
There was a problem hiding this comment.
It seems there's no source code changed in OData.Core project.
Issues
This pull request fixes #2502.
Description
OData 4.01 adds the ability to distinguish nav prop bindings to the same navigation property by type by appending a type segment.
This PR adds support to ODL to have different navigation property bindings to the same navigation property that vary by type.
Checklist (Uncheck if it is not completed)
Additional work necessary
Consider only writing nav prop bindings that terminate in type segment for 4.01 responses.