I have a generic class Parameter with a generic property Value:
abstract class Parameter<T> {
public T Value { get; set; }
}
StringParameter class inherits the Parameter class:
class StringParameter : Parameter<string> {
//...
}
Is it possible to properly map the StringParameter class so that it contains the generic Value property?
When trying to map the StringParameter class with the code below (and various other approaches) the best I could do is get an exception with the message: "The memberInfo argument must be for class StringParameter, but was for class Parameter`1."
BsonClassMap.RegisterClassMap<StringParameter>(cm => {
cm.AutoMap();
cm.MapMember(typeof(StringParameter).GetRuntimeProperty("Value"));
});