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
327
327
}
328
328
}
329
329
330
- public static IEnumerable < OdcmProperty > NavigationProperties ( this OdcmClass odcmClass )
330
+ public static IEnumerable < OdcmProperty > NavigationProperties ( this OdcmClass odcmClass , bool includeBaseProperties = false )
331
331
{
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 > ( ) ) ;
333
336
}
334
337
335
338
public static bool IsNavigation ( this OdcmProperty property )
@@ -488,14 +491,8 @@ public static List<OdcmMethod> WithDistinctOverloads(this OdcmMethod odcmMethod)
488
491
/// Returns a List containing the supplied class' methods plus their overloads
489
492
public static List < OdcmMethod > MethodsAndOverloads ( this OdcmClass odcmClass )
490
493
{
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 ( ) ;
497
495
}
498
-
499
496
}
500
497
501
498
}
You can’t perform that action at this time.
0 commit comments