@@ -1197,23 +1197,40 @@ public static string CreatePackageDef(this CustomT4Host host)
11971197 methodImports . Add ( string . Format ( importFormat , p . Class . Namespace . Name . AddPrefix ( ) , p . Class . GetPackagePrefix ( ) , p . Class . GetTypeString ( ) ) ) ;
11981198 if ( ! ( p . Projection . Type is OdcmPrimitiveType ) )
11991199 methodImports . Add ( string . Format ( importFormat , p . Projection . Type . Namespace . Name . AddPrefix ( ) , p . Projection . Type . GetPackagePrefix ( ) , p . Projection . Type . GetTypeString ( ) ) ) ;
1200- p . Projection ? . Type ? . AsOdcmClass ( ) ? . MethodsAndOverloads ( ) ? . Distinct ( ) ? . SelectMany ( o => ImportClassesOfMethodParameters ( o ) ) ? . ToList ( ) ? . ForEach ( x => methodImports . Add ( x ) ) ;
1200+ p . Projection ? . Type ? . AsOdcmClass ( ) ? . MethodsAndOverloads ( )
1201+ ? . Distinct ( )
1202+ ? . SelectMany ( o => ImportClassesOfMethodParameters ( o ) )
1203+ ? . ToList ( )
1204+ ? . ForEach ( x => methodImports . Add ( x ) ) ;
12011205 break ;
12021206 case OdcmMethod m :
1203- m . WithDistinctOverloads ( ) . SelectMany ( o => ImportClassesOfMethodParameters ( o ) ) ? . ToList ( ) ? . ForEach ( x => methodImports . Add ( x ) ) ;
1207+ m . WithDistinctOverloads ( )
1208+ . SelectMany ( o => ImportClassesOfMethodParameters ( o ) )
1209+ ? . ToList ( )
1210+ ? . ForEach ( x => methodImports . Add ( x ) ) ;
12041211 goto default ;
12051212 case OdcmClass c :
12061213 if ( c . GetTypeString ( ) != graphServiceEntityName )
12071214 methodImports . Add ( string . Format ( importFormat , c . Namespace . Name . AddPrefix ( ) , c . GetPackagePrefix ( ) , c . GetTypeString ( ) ) ) ;
12081215
12091216 var importTypeToExclude = host . TemplateFile . EndsWith ( "BaseEntityRequest.java.tt" ) ? host . TemplateName : string . Empty ;
1210- c ? . MethodsAndOverloads ( ) ? . Distinct ( ) ? . SelectMany ( o => ImportClassesOfMethodParameters ( o , importTypeToExclude : importTypeToExclude ) ) ? . ToList ( ) ? . ForEach ( x => methodImports . Add ( x ) ) ;
1211- c ? . NavigationProperties ( ) ? . Where ( x => x . IsCollection ) ? . Select ( x => x . Projection . Type ) ? . Distinct ( ) ? . ToList ( ) ? . ForEach ( x =>
1212- ImportRequestBuilderTypes ( host , x , methodImports , importFormat , interfaceTemplatePrefix , true )
1213- ) ;
1214- c ? . NavigationProperties ( ) ? . Where ( x => ! x . IsCollection ) ? . Select ( x => x . Projection . Type ) ? . Distinct ( ) ? . ToList ( ) ? . ForEach ( x =>
1215- ImportRequestBuilderTypes ( host , x , methodImports , importFormat , interfaceTemplatePrefix , false )
1216- ) ;
1217+ c ? . MethodsAndOverloads ( )
1218+ ? . Distinct ( )
1219+ ? . SelectMany ( o => ImportClassesOfMethodParameters ( o , importTypeToExclude : importTypeToExclude ) )
1220+ ? . ToList ( )
1221+ ? . ForEach ( x => methodImports . Add ( x ) ) ;
1222+ c ? . NavigationProperties ( )
1223+ ? . Where ( x => x . IsCollection ) ?
1224+ . Select ( x => x . Projection . Type )
1225+ ? . Distinct ( )
1226+ ? . ToList ( )
1227+ ? . ForEach ( x => ImportRequestBuilderTypes ( host , x , methodImports , importFormat , interfaceTemplatePrefix , true ) ) ;
1228+ c ? . NavigationProperties ( )
1229+ ? . Where ( x => ! x . IsCollection )
1230+ ? . Select ( x => x . Projection . Type )
1231+ ? . Distinct ( )
1232+ ? . ToList ( )
1233+ ? . ForEach ( x => ImportRequestBuilderTypes ( host , x , methodImports , importFormat , interfaceTemplatePrefix , false ) ) ;
12171234 goto default ;
12181235 default :
12191236 @namespace = host . CurrentNamespace ( ) ;
0 commit comments