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
257257 @namespace
258258 . Classes
259259 . 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
264264 . Type
265265 . AsOdcmClass ( )
266266 . Properties
267267 //Find navigation properties on the singleton that are self-contained (implicit EntitySets) that match the type
268268 //we are searching for
269269 . Where ( prop => prop . ContainsTarget == true && prop . Type . Name == odcmProperty . Type . Name )
270270 . FirstOrDefault ( ) != null
271- )
271+ ) ?? new OdcmProperty [ ] { }
272272 ) . FirstOrDefault ( ) ;
273273
274274 if ( implicitProperty != null )
You can’t perform that action at this time.
0 commit comments