You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For my current code, I need to deserialize a yaml file with a few expected properties. There are a few properties I expect in the yaml file such as Name, Type, but the rest of the properties are unknown. My object would have those known properties defined and I want to be able to store the rest of unknow properties in a dictionary<string, object>. below is an example of my class:
public class DynamicObj
{
[Required]
public string Name { get; set; }
public string Type { get; set; }
private readonly Dictionary<string, object> _dictionary = new Dictionary<string, object>();
public object this[string key] { get => _dictionary[key]; set => _dictionary[key] = value; }
}
I was trying out creating a custom INodeDeserializer. However, I need the TypeInspector to return the IPropertyDescriptor of the expected properties ( var property = typeDescriptor.GetProperty(expectedType, null, propertyName.Value, ignoreUnmatched);
) and I got stuck here. Do you have any suggestion on the issue?
The text was updated successfully, but these errors were encountered:
For my current code, I need to deserialize a yaml file with a few expected properties. There are a few properties I expect in the yaml file such as Name, Type, but the rest of the properties are unknown. My object would have those known properties defined and I want to be able to store the rest of unknow properties in a dictionary<string, object>. below is an example of my class:
}
I was trying out creating a custom INodeDeserializer. However, I need the TypeInspector to return the IPropertyDescriptor of the expected properties ( var property = typeDescriptor.GetProperty(expectedType, null, propertyName.Value, ignoreUnmatched);
) and I got stuck here. Do you have any suggestion on the issue?
The text was updated successfully, but these errors were encountered: