I am trying to write a good consumer API for protocol-based middleware in C #. ConfigManager.GetSection(...) returns an object, so I want to return a dynamic object that, when I click on the required type, causes a display.
Is there a way in C # 4 + to create a dynamic class that can handle a call if there is an explicit cast to it?
eg.
MyConfig config = (MyConfig)ConfigurationManager.GetSection("some/section");
In this case, the dynamic object from the ConfigurationManager will be called by the application to perform some configuration magic (I solved this bit)
source share