Repository navigation
Fix issue for nested next page link with singleton containment navigation property #710
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
Changes from 10 commits
e5786e5
71acab0
5333a9d
99f5657
3e8aa4f
bb120c6
863f4e1
909f2d9
be1611e
23218a2
a4ed6e9
66007f9
a433304
7818913
aeb8e39
05a450e
012d13c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -349,13 +349,13 @@ internal static IList<ODataPathSegment> GenerateBaseODataPathSegments(this Resou | |
| return odataPath; | ||
| } | ||
|
|
||
| private static void GenerateBaseODataPathSegmentsForNonSingletons( | ||
| private static void GenerateBaseODataPathSegmentsForContainedNavProperties( | ||
| ODataPath path, | ||
| IEdmNavigationSource navigationSource, | ||
| IList<ODataPathSegment> odataPath) | ||
| { | ||
| // If the navigation is not a singleton we need to walk all of the path segments to generate a | ||
| // contextually accurate URI. | ||
| // If the navigation is a contained property, we need to walk all of the path segments | ||
| // to generate a contextually accurate URI. | ||
| bool segmentFound = false; | ||
| bool containedFound = false; | ||
| if (path != null) | ||
|
|
@@ -379,6 +379,14 @@ private static void GenerateBaseODataPathSegmentsForNonSingletons( | |
| { | ||
| currentNavigationSource = navigationPathSegment.NavigationSource; | ||
| } | ||
|
|
||
| var singletonPathSegment = pathSegment as SingletonSegment; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we want to have an
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this would involve a change to another repo, this could be a good feature for the future.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, if you've talked to others and think is the path we actually want to go, can you create a github issue for it? If we aren't going that route, you can resolve this |
||
| if (singletonPathSegment != null) | ||
| { | ||
| currentNavigationSource = singletonPathSegment.Singleton; | ||
| } | ||
|
|
||
|
|
||
| if (containedFound) | ||
| { | ||
| odataPath.Add(pathSegment); | ||
|
|
@@ -440,9 +448,9 @@ private static void GenerateBaseODataPathSegmentsForEntity( | |
| this ResourceContext resourceContext, | ||
| IList<ODataPathSegment> odataPath) | ||
| { | ||
| // If the navigation is not a singleton we need to walk all of the path segments to generate a | ||
| // contextually accurate URI. | ||
| GenerateBaseODataPathSegmentsForNonSingletons( | ||
| // If the navigation is a contained property, we need to walk all of the path segments | ||
| // to generate a contextually accurate URI. | ||
| GenerateBaseODataPathSegmentsForContainedNavProperties( | ||
| resourceContext.SerializerContext.Path, resourceContext.NavigationSource, odataPath); | ||
|
|
||
| odataPath.Add(new KeySegment(ConventionsHelpers.GetEntityKey(resourceContext), resourceContext.StructuredType as IEdmEntityType, | ||
|
|
@@ -453,7 +461,7 @@ private static void GenerateBaseODataPathSegmentsForFeed( | |
| this ResourceSetContext feedContext, | ||
| IList<ODataPathSegment> odataPath) | ||
| { | ||
| GenerateBaseODataPathSegmentsForNonSingletons(feedContext.Request.ODataFeature().Path, | ||
| GenerateBaseODataPathSegmentsForContainedNavProperties(feedContext.Request.ODataFeature().Path, | ||
| feedContext.EntitySetBase, | ||
| odataPath); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.