1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.Json;
- using System.Threading.Tasks;
- namespace JsonRPC4.Router
- {
- public class JsonBytesRpcParameter : IRpcParameter
- {
- public RpcParameterType Type
- {
- get;
- }
- private Memory<byte> bytes
- {
- get;
- }
- private JsonSerializerOptions serializerOptions
- {
- get;
- }
- public JsonBytesRpcParameter(RpcParameterType type, Memory<byte> bytes, JsonSerializerOptions serializerOptions = null)
- {
- //IL_000e: Unknown result type (might be due to invalid IL or missing references)
- //IL_000f: Unknown result type (might be due to invalid IL or missing references)
- Type = type;
- this.bytes = bytes;
- this.serializerOptions = serializerOptions;
- }
- public bool TryGetValue(Type type, out object value)
- {
- //IL_0002: Unknown result type (might be due to invalid IL or missing references)
- //IL_0007: Unknown result type (might be due to invalid IL or missing references)
- //IL_000a: Unknown result type (might be due to invalid IL or missing references)
- //IL_000f: Unknown result type (might be due to invalid IL or missing references)
- try
- {
- value = JsonSerializer.Deserialize(this.bytes.Span, type, this.serializerOptions);
- return true;
- }
- catch (Exception)
- {
- value = null;
- return false;
- }
- }
- }
- }
|