@@ -1197,23 +1197,40 @@ public static string CreatePackageDef(this CustomT4Host host)
1197
1197
methodImports . Add ( string . Format ( importFormat , p . Class . Namespace . Name . AddPrefix ( ) , p . Class . GetPackagePrefix ( ) , p . Class . GetTypeString ( ) ) ) ;
1198
1198
if ( ! ( p . Projection . Type is OdcmPrimitiveType ) )
1199
1199
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 ) ) ;
1201
1205
break ;
1202
1206
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 ) ) ;
1204
1211
goto default ;
1205
1212
case OdcmClass c :
1206
1213
if ( c . GetTypeString ( ) != graphServiceEntityName )
1207
1214
methodImports . Add ( string . Format ( importFormat , c . Namespace . Name . AddPrefix ( ) , c . GetPackagePrefix ( ) , c . GetTypeString ( ) ) ) ;
1208
1215
1209
1216
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 ) ) ;
1217
1234
goto default ;
1218
1235
default :
1219
1236
@namespace = host . CurrentNamespace ( ) ;
0 commit comments