@@ -11,6 +11,9 @@ internal abstract class ApiClientBase(HttpClient httpClient, ILogger<ICgScriptAp
11
11
public async Task < ScriptResult < TR > > Execute < TP , TR > ( string scriptName , TP parameter , JsonTypeInfo < TP > callJsonTypeInfo , JsonTypeInfo < TR > resultJsonTypeInfo , CancellationToken cancellationToken ) =>
12
12
await ParseResponse ( await httpClient . PostAsync ( await GetPath ( scriptName ) , await GetJsonContent ( scriptName , parameter , callJsonTypeInfo ) , cancellationToken ) . ConfigureAwait ( false ) , resultJsonTypeInfo , cancellationToken ) ;
13
13
14
+ public async Task < ScriptResult < TR > > ExecuteArray < TP , TR > ( string scriptName , TP parameter , JsonTypeInfo < TP > callJsonTypeInfo , JsonTypeInfo < TR > resultJsonTypeInfo , CancellationToken cancellationToken ) =>
15
+ await ParseResponse ( await httpClient . PostAsync ( await GetPath ( scriptName , "?expandParameters=true" ) , await GetJsonContent ( scriptName , parameter , callJsonTypeInfo ) , cancellationToken ) . ConfigureAwait ( false ) , resultJsonTypeInfo , cancellationToken ) ;
16
+
14
17
public async Task < ScriptResult < TR > > Execute < TR > ( string scriptName , JsonTypeInfo < TR > resultJsonTypeInfo , CancellationToken cancellationToken = default ) =>
15
18
await ParseResponse ( await httpClient . PostAsync ( await GetPath ( scriptName , "?expandParameters=true" ) , await GetJsonContent ( scriptName , null , ( JsonTypeInfo < object > ) null ! ) , cancellationToken ) . ConfigureAwait ( false ) , resultJsonTypeInfo , cancellationToken ) ;
16
19
@@ -30,6 +33,9 @@ private async Task<ScriptResult<TR>> ParseResponse<TR>(HttpResponseMessage call,
30
33
[ RequiresUnreferencedCode ( "JSON" ) ]
31
34
public async Task < ScriptResult < TR > > Execute < TP , TR > ( string scriptName , TP parameter , JsonSerializerOptions ? options , CancellationToken cancellationToken = default ) =>
32
35
await ParseResponse < TR > ( await httpClient . PostAsync ( await GetPath ( scriptName ) , await GetJsonContent ( scriptName , parameter , options ) , cancellationToken ) . ConfigureAwait ( false ) , options , cancellationToken ) ;
36
+ [ RequiresUnreferencedCode ( "JSON" ) ]
37
+ public async Task < ScriptResult < TR > > ExecuteArray < TP , TR > ( string scriptName , TP parameter , JsonSerializerOptions ? options , CancellationToken cancellationToken = default ) =>
38
+ await ParseResponse < TR > ( await httpClient . PostAsync ( await GetPath ( scriptName , "?expandParameters=true" ) , await GetJsonContent ( scriptName , parameter , options ) , cancellationToken ) . ConfigureAwait ( false ) , options , cancellationToken ) ;
33
39
34
40
[ RequiresUnreferencedCode ( "JSON" ) ]
35
41
public async Task < ScriptResult < TR > > Execute < TR > ( string scriptName , IReadOnlyCollection < object > parameters , JsonSerializerOptions ? options = null , CancellationToken cancellationToken = default ) =>
0 commit comments