File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
src/GraphODataTemplateWriter/Extensions Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -327,9 +327,12 @@ public static bool IsBaseAbstractAndReferencedAsPropertyType(this OdcmClass comp
327327 }
328328 }
329329
330- public static IEnumerable < OdcmProperty > NavigationProperties ( this OdcmClass odcmClass )
330+ public static IEnumerable < OdcmProperty > NavigationProperties ( this OdcmClass odcmClass , bool includeBaseProperties = false )
331331 {
332- return odcmClass . Properties . Where ( prop => prop . IsNavigation ( ) ) ;
332+ return odcmClass . Properties . Where ( prop => prop . IsNavigation ( ) )
333+ . Union ( includeBaseProperties && odcmClass . Base != null ?
334+ odcmClass . Base . Properties . Where ( x => x . IsNavigation ( ) ) :
335+ new List < OdcmProperty > ( ) ) ;
333336 }
334337
335338 public static bool IsNavigation ( this OdcmProperty property )
@@ -488,14 +491,8 @@ public static List<OdcmMethod> WithDistinctOverloads(this OdcmMethod odcmMethod)
488491 /// Returns a List containing the supplied class' methods plus their overloads
489492 public static List < OdcmMethod > MethodsAndOverloads ( this OdcmClass odcmClass )
490493 {
491- var allMethods = new List < OdcmMethod > ( ) ;
492- foreach ( var method in odcmClass . Methods )
493- {
494- allMethods . AddRange ( method . WithOverloads ( ) ) ;
495- }
496- return allMethods ;
494+ return odcmClass . Methods . SelectMany ( x => x . WithOverloads ( ) ) . ToList ( ) ;
497495 }
498-
499496 }
500497
501498}
You can’t perform that action at this time.
0 commit comments