JsonRpcRequest.TryGetArgumentByNameOrIndex 메서드

정의

RPC 요청에 대한 인수를 검색합니다.

public virtual bool TryGetArgumentByNameOrIndex (string name, int position, Type typeHint, out object value);
public virtual bool TryGetArgumentByNameOrIndex (string? name, int position, Type? typeHint, out object? value);
abstract member TryGetArgumentByNameOrIndex : string * int * Type * obj -> bool
override this.TryGetArgumentByNameOrIndex : string * int * Type * obj -> bool
Public Overridable Function TryGetArgumentByNameOrIndex (name As String, position As Integer, typeHint As Type, ByRef value As Object) As Boolean

매개 변수

name
String

인수가 필요한 매개 변수의 이름입니다. 호출자가 위치 인수를 원한다는 것을 알고 있는 경우 null일 수 있습니다.

position
Int32

인수가 필요한 매개 변수의 인덱스입니다. 위치가 없는 인수의 경우 -1일 수 있습니다.

typeHint
Type

인수가 필요한 매개 변수의 형식입니다. 형식을 강제 변환할 필요가 없는 경우 null일 수 있습니다.

value
Object

인수가 있는 경우 인수의 값을 받습니다. 을 준수하지 않더라도 반환될 수 있습니다 typeHint.

반환

true 지정된 이름 또는 위치를 가진 매개 변수에 인수를 사용할 수 있으면 이고, false 그렇지 않으면.

예외

인수가 존재하지만 역직렬화할 수 없는 경우 throw됩니다.

설명

파생 형식은 형식 요구 사항을 충족할 수 있도록 요청 시 필요한 인수를 고려하고 typeHint 역직렬화하기 위해 이 메서드를 재정의할 수 있습니다.

적용 대상