diff --git a/CryptoExchange.Net.Protobuf/Converters/Protobuf/ProtobufMessageAccessor.cs b/CryptoExchange.Net.Protobuf/Converters/Protobuf/ProtobufMessageAccessor.cs
index 8414246..d16efab 100644
--- a/CryptoExchange.Net.Protobuf/Converters/Protobuf/ProtobufMessageAccessor.cs
+++ b/CryptoExchange.Net.Protobuf/Converters/Protobuf/ProtobufMessageAccessor.cs
@@ -40,6 +40,10 @@ namespace CryptoExchange.Net.Converters.Protobuf
/// The intermediate deserialization object
///
protected TIntermediateType? _intermediateType;
+ ///
+ /// Runtime type model
+ ///
+ protected RuntimeTypeModel _model;
///
public bool IsValid { get; set; }
@@ -48,19 +52,20 @@ namespace CryptoExchange.Net.Converters.Protobuf
public abstract bool OriginalDataAvailable { get; }
///
- public object? Underlying => throw new NotImplementedException();
+ public object? Underlying => _intermediateType;
///
/// ctor
///
- public ProtobufMessageAccessor()
+ public ProtobufMessageAccessor(RuntimeTypeModel model)
{
+ _model = model;
}
///
public NodeType? GetNodeType()
{
- throw new Exception("");
+ throw new NotImplementedException();
}
///
@@ -82,7 +87,9 @@ namespace CryptoExchange.Net.Converters.Protobuf
else if (step.Type == 1)
{
// property value
+#pragma warning disable IL2075 // Type is already annotated
value = value.GetType().GetProperty(step.Property!)?.GetValue(value);
+#pragma warning restore
}
else
{
@@ -136,7 +143,9 @@ namespace CryptoExchange.Net.Converters.Protobuf
else if (step.Type == 1)
{
// property value
+#pragma warning disable IL2075 // Type is already annotated
value = value.GetType().GetProperty(step.Property!)?.GetValue(value);
+#pragma warning restore
}
else
{
@@ -150,8 +159,7 @@ namespace CryptoExchange.Net.Converters.Protobuf
///
public T?[]? GetValues(MessagePath path)
{
- throw new Exception("");
-
+ throw new NotImplementedException();
}
///
@@ -161,6 +169,10 @@ namespace CryptoExchange.Net.Converters.Protobuf
public abstract void Clear();
///
+#if NET5_0_OR_GREATER
+ [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2092:RequiresUnreferencedCode", Justification = "JsonSerializerOptions provided here has TypeInfoResolver set")]
+ [UnconditionalSuppressMessage("AssemblyLoadTrimming", "IL2095:RequiresUnreferencedCode", Justification = "JsonSerializerOptions provided here has TypeInfoResolver set")]
+#endif
public abstract CallResult