@@ -370,32 +370,32 @@ private IReadOnlyList<MethodBodyStatement> BuildLroHandling(
370
370
var statements = new List < MethodBodyStatement > ( ) ;
371
371
372
372
var finalStateVia = method . GetOperationFinalStateVia ( ) ;
373
- var isGeneric = method . GetResponseBodyType = = null ;
373
+ bool isGeneric = method . GetResponseBodyType ( ) ! = null ;
374
374
375
375
var armOperationType = isGeneric
376
- ? ManagementClientGenerator . Instance . OutputLibrary . ArmOperation . Type
377
- : ManagementClientGenerator . Instance . OutputLibrary . GenericArmOperation . Type . MakeGenericType ( [ resourceClientType ] ) ;
376
+ ? ManagementClientGenerator . Instance . OutputLibrary . GenericArmOperation . Type . MakeGenericType ( [ resourceClientType ] )
377
+ : ManagementClientGenerator . Instance . OutputLibrary . ArmOperation . Type ;
378
378
379
379
ValueExpression [ ] armOperationArguments = [
380
380
_clientDiagnosticsField ,
381
381
This . Property ( "Pipeline" ) ,
382
382
messageVariable . Property ( "Request" ) ,
383
- isGeneric ? responseVariable : responseVariable . Invoke ( "GetRawResponse" ) ,
383
+ isGeneric ? responseVariable . Invoke ( "GetRawResponse" ) : responseVariable ,
384
384
Static ( typeof ( OperationFinalStateVia ) ) . Property ( finalStateVia . ToString ( ) )
385
385
] ;
386
386
387
387
var operationInstanceArguments = isGeneric
388
- ? armOperationArguments
389
- : [ New . Instance ( operationSourceType , armClientProperty ) , .. armOperationArguments ] ;
388
+ ? [ New . Instance ( operationSourceType , armClientProperty ) , .. armOperationArguments ]
389
+ : armOperationArguments ;
390
390
391
391
var operationDeclaration = Declare ( "operation" , armOperationType , New . Instance ( armOperationType , operationInstanceArguments ) , out var operationVariable ) ;
392
392
statements . Add ( operationDeclaration ) ;
393
393
394
394
var waitIfCompletedStatement = new IfStatement ( KnownAzureParameters . WaitUntil . Equal ( Static ( typeof ( WaitUntil ) ) . Property ( nameof ( WaitUntil . Completed ) ) ) )
395
395
{
396
396
isAsync
397
- ? operationVariable . Invoke ( isGeneric ? "WaitForCompletionResponseAsync " : "WaitForCompletionAsync " , [ cancellationTokenParameter ] , null , isAsync ) . Terminate ( )
398
- : operationVariable . Invoke ( isGeneric ? "WaitForCompletionResponse " : "WaitForCompletion " , cancellationTokenParameter ) . Terminate ( )
397
+ ? operationVariable . Invoke ( isGeneric ? "WaitForCompletionAsync " : "WaitForCompletionResponseAsync " , [ cancellationTokenParameter ] , null , isAsync ) . Terminate ( )
398
+ : operationVariable . Invoke ( isGeneric ? "WaitForCompletion " : "WaitForCompletionResponse " , cancellationTokenParameter ) . Terminate ( )
399
399
} ;
400
400
statements . Add ( waitIfCompletedStatement ) ;
401
401
0 commit comments