File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
src/GraphODataTemplateWriter/Extensions Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -257,18 +257,18 @@ public static OdcmProperty GetServiceCollectionNavigationPropertyForPropertyType
257
257
@namespace
258
258
. Classes
259
259
. Where ( odcmClass => odcmClass . Kind == OdcmClassKind . Service )
260
- . First ( )
261
- . Properties
262
- . Where ( property => property . GetType ( ) == typeof ( OdcmSingleton ) ) //Get the list of singletons defined by the service
263
- . Where ( singleton => singleton
260
+ . FirstOrDefault ( )
261
+ ? . Properties
262
+ ? . Where ( property => property . GetType ( ) == typeof ( OdcmSingleton ) ) //Get the list of singletons defined by the service
263
+ ? . Where ( singleton => singleton
264
264
. Type
265
265
. AsOdcmClass ( )
266
266
. Properties
267
267
//Find navigation properties on the singleton that are self-contained (implicit EntitySets) that match the type
268
268
//we are searching for
269
269
. Where ( prop => prop . ContainsTarget == true && prop . Type . Name == odcmProperty . Type . Name )
270
270
. FirstOrDefault ( ) != null
271
- )
271
+ ) ?? new OdcmProperty [ ] { }
272
272
) . FirstOrDefault ( ) ;
273
273
274
274
if ( implicitProperty != null )
You can’t perform that action at this time.
0 commit comments