Let's say I have a class that inherits from DynamicObject:
public class DynamicBase : DynamicObject
{
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
}
}
and then I have a child class that inherits from DynamicBase:
public class ChildClass : DynamicBase
{
public void SomeProperty { get; set; }
}
I would like to automatically track both the getter and setter from "SomeProperty" in the child class. Currently, since SomeProperty exists in the child, methods are not redirected to TryGet / SetMember or any other DynamicObject override.
Ideally, I would like this behavior after the user of the base class creates an instance of the object, for example:
var someInstance = new ChildClass();
someInstance.SomeProperty = "someValue"
as opposed to having to instantiate a DynamicBase when the child is passed as a type (how does Moq create hooks using DynamicProxy):
var someInstance = new DynamicBase<ChildClass>();
, :
- #?
- DynamicObject ; IDynamicMetaObjectProvider - ?
- DynamicBase, - ChildClass , , - DynamicProxy ?