JsonRpc.InvokeCoreAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, CancellationToken)
Richiama il metodo RPC specificato.
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (StreamJsonRpc.RequestId id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Threading.CancellationToken cancellationToken);
member this.InvokeCoreAsync : StreamJsonRpc.RequestId * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As RequestId, targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo restituito del metodo RPC.
Parametri
- id
- RequestId
Identificatore stabilito dal client che DEVE contenere un valore String, Number o NULL, se incluso. Se non è incluso, si presuppone che sia una notifica.
- targetName
- String
Nome del metodo da richiamare. Non deve esser null o vuoto.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Devono essere serializzabili usando l'oggetto selezionato IJsonRpcMessageFormatter. Se null
, non vengono passati argomenti.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
Restituisce
Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.
Si applica a
InvokeCoreAsync<TResult>(Nullable<Int32>, String, IReadOnlyList<Object>, CancellationToken)
Richiama il metodo RPC specificato
protected virtual System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (int? id, string targetName, System.Collections.Generic.IReadOnlyList<object> arguments, System.Threading.CancellationToken cancellationToken);
abstract member InvokeCoreAsync : Nullable<int> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
override this.InvokeCoreAsync : Nullable<int> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Protected Overridable Function InvokeCoreAsync(Of TResult) (id As Nullable(Of Integer), targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo restituito del metodo RPC
Parametri
Identificatore stabilito dal client che DEVE contenere un valore String, Number o NULL, se incluso. Se non è incluso, si presuppone che sia una notifica.
- targetName
- String
Nome del metodo da richiamare.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Se null, non vengono passati argomenti.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
Restituisce
Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.
Si applica a
InvokeCoreAsync<TResult>(Nullable<Int64>, String, IReadOnlyList<Object>, CancellationToken)
Attenzione
Use the InvokeCoreAsync(RequestId, ...) overload instead.
Richiama il metodo RPC specificato.
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (long? id, string targetName, System.Collections.Generic.IReadOnlyList<object> arguments, System.Threading.CancellationToken cancellationToken);
[System.Obsolete("Use the InvokeCoreAsync(RequestId, ...) overload instead.")]
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (long? id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Threading.CancellationToken cancellationToken);
member this.InvokeCoreAsync : Nullable<int64> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
[<System.Obsolete("Use the InvokeCoreAsync(RequestId, ...) overload instead.")>]
member this.InvokeCoreAsync : Nullable<int64> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As Nullable(Of Long), targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo restituito del metodo RPC.
Parametri
Identificatore stabilito dal client che DEVE contenere un valore String, Number o NULL, se incluso. Se non è incluso, si presuppone che sia una notifica.
- targetName
- String
Nome del metodo da richiamare. Non deve esser null o vuoto.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Devono essere serializzabili usando l'oggetto selezionato IJsonRpcMessageFormatter. Se null
, non vengono passati argomenti.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
Restituisce
Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.
- Attributi
Si applica a
InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, CancellationToken, Boolean)
Richiama il metodo RPC specificato.
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (StreamJsonRpc.RequestId id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
member this.InvokeCoreAsync : StreamJsonRpc.RequestId * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As RequestId, targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken, isParameterObject As Boolean) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo restituito del metodo RPC.
Parametri
- id
- RequestId
Identificatore stabilito dal client. Se viene specificato il valore predefinito, si presuppone che sia una notifica.
- targetName
- String
Nome del metodo da richiamare.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Se null, non vengono passati argomenti.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
- isParameterObject
- Boolean
Valore che indica se il parametro deve essere passato come oggetto .
Restituisce
Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.
Si applica a
InvokeCoreAsync<TResult>(Nullable<Int32>, String, IReadOnlyList<Object>, CancellationToken, Boolean)
Richiama il metodo RPC specificato
protected virtual System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (int? id, string targetName, System.Collections.Generic.IReadOnlyList<object> arguments, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
abstract member InvokeCoreAsync : Nullable<int> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
override this.InvokeCoreAsync : Nullable<int> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
Protected Overridable Function InvokeCoreAsync(Of TResult) (id As Nullable(Of Integer), targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken, isParameterObject As Boolean) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo restituito del metodo RPC
Parametri
Identificatore stabilito dal client che DEVE contenere un valore String, Number o NULL, se incluso. Se non è incluso, si presuppone che sia una notifica.
- targetName
- String
Nome del metodo da richiamare.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Se null, non vengono passati argomenti.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
- isParameterObject
- Boolean
Valore che indica se il parametro deve essere passato come oggetto .
Restituisce
Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.
Si applica a
InvokeCoreAsync<TResult>(Nullable<Int64>, String, IReadOnlyList<Object>, CancellationToken, Boolean)
Attenzione
Use the InvokeCoreAsync(RequestId, ...) overload instead.
Richiama un metodo specifico in un server JSON-RPC.
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (long? id, string targetName, System.Collections.Generic.IReadOnlyList<object> arguments, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
[System.Obsolete("Use the InvokeCoreAsync(RequestId, ...) overload instead.")]
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (long? id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
member this.InvokeCoreAsync : Nullable<int64> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
[<System.Obsolete("Use the InvokeCoreAsync(RequestId, ...) overload instead.")>]
member this.InvokeCoreAsync : Nullable<int64> * string * System.Collections.Generic.IReadOnlyList<obj> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As Nullable(Of Long), targetName As String, arguments As IReadOnlyList(Of Object), cancellationToken As CancellationToken, isParameterObject As Boolean) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo restituito del metodo RPC.
Parametri
Identificatore stabilito dal client. Se viene specificato il valore predefinito, si presuppone che sia una notifica.
- targetName
- String
Nome del metodo da richiamare. Non deve esser null o vuoto.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Devono essere serializzabili usando l'oggetto selezionato IJsonRpcMessageFormatter. Se null
, non vengono passati argomenti.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione della richiesta.
- isParameterObject
- Boolean
Valore che indica se il parametro deve essere passato come oggetto .
Restituisce
Attività il cui risultato è la risposta deserializzata dal server JSON-RPC.
- Attributi
Si applica a
InvokeCoreAsync<TResult>(RequestId, String, IReadOnlyList<Object>, IReadOnlyList<Type>, IReadOnlyDictionary<String,Type>, CancellationToken, Boolean)
Richiama un determinato metodo in un server JSON-RPC.
protected System.Threading.Tasks.Task<TResult> InvokeCoreAsync<TResult> (StreamJsonRpc.RequestId id, string targetName, System.Collections.Generic.IReadOnlyList<object?>? arguments, System.Collections.Generic.IReadOnlyList<Type>? positionalArgumentDeclaredTypes, System.Collections.Generic.IReadOnlyDictionary<string,Type>? namedArgumentDeclaredTypes, System.Threading.CancellationToken cancellationToken, bool isParameterObject);
member this.InvokeCoreAsync : StreamJsonRpc.RequestId * string * System.Collections.Generic.IReadOnlyList<obj> * System.Collections.Generic.IReadOnlyList<Type> * System.Collections.Generic.IReadOnlyDictionary<string, Type> * System.Threading.CancellationToken * bool -> System.Threading.Tasks.Task<'Result>
Protected Function InvokeCoreAsync(Of TResult) (id As RequestId, targetName As String, arguments As IReadOnlyList(Of Object), positionalArgumentDeclaredTypes As IReadOnlyList(Of Type), namedArgumentDeclaredTypes As IReadOnlyDictionary(Of String, Type), cancellationToken As CancellationToken, isParameterObject As Boolean) As Task(Of TResult)
Parametri di tipo
- TResult
Tipo restituito del metodo RPC.
Parametri
- id
- RequestId
Identificatore stabilito dal client. Se viene specificato il valore predefinito, si presuppone che sia una notifica.
- targetName
- String
Nome del metodo da richiamare. Non deve esser null o vuoto.
- arguments
- IReadOnlyList<Object>
Argomenti da passare al metodo richiamato. Devono essere serializzabili usando l'oggetto selezionato IJsonRpcMessageFormatter. Se null
, non vengono passati argomenti.
- positionalArgumentDeclaredTypes
- IReadOnlyList<Type>
Elenco di Type oggetti che descrivono il modo in cui ogni elemento in arguments
è previsto dal server da digitare.
Se specificato, deve avere esattamente la stessa lunghezza di arguments
e non contenere null
elementi.
Questo valore viene ignorato quando isParameterObject
è true.
- namedArgumentDeclaredTypes
- IReadOnlyDictionary<String,Type>
Dizionario di Type oggetti che descrivono il modo in cui ogni voce specificata nell'unico IReadOnlyDictionary<TKey,TValue> elemento di arguments
è prevista dal server da digitare.
Se specificato, deve avere esattamente lo stesso set di chiavi del dizionario contenuto nel primo elemento di arguments
e non contenere null
valori.
- cancellationToken
- CancellationToken
Token il cui annullamento deve segnalare al server di interrompere l'elaborazione di questa richiesta.
- isParameterObject
- Boolean
Valore che indica se il parametro deve essere passato come oggetto.
Restituisce
Attività che completa la risposta dal server JSON-RPC.
Eccezioni
Generata dopo cancellationToken
l'annullamento.
Se la richiesta è già stata trasmessa, l'eccezione viene generata solo dopo che il server ha ricevuto la notifica di annullamento e ha risposto.
Se il server completa la richiesta anziché annullare, questa eccezione non verrà generata.
Quando la connessione viene eliminata prima di ricevere una risposta, questa eccezione viene generata se cancellationToken
è stata annullata.
Classe base comune per un'ampia gamma di eccezioni RPC che possono essere generate. Alcuni tipi derivati comuni sono elencati singolarmente.
Generata quando viene restituito un errore dal server in conseguenza dell'esecuzione del metodo richiesto.
Generata quando il server segnala che non è stato trovato alcun metodo corrispondente da richiamare.
Se targetName
è Null.
Generata quando targetName
è vuota.
Se questa istanza di è già stata eliminata prima di JsonRpc questa chiamata.
Generata quando la connessione viene terminata (da entrambi i lati) prima della richiesta o mentre la richiesta è in corso, a meno che non cancellationToken
sia già segnalato.
Qualsiasi eccezione generata da IJsonRpcMessageFormatter ( in genere a causa di errori di serializzazione). Quando si usa JsonMessageFormatter questo deve essere Newtonsoft.Json.JsonSerializationException. Quando si usa MessagePackFormatter questo deve essere MessagePack.MessagePackSerializationException.