Skip to content
Jay Tuley edited this page Mar 19, 2018 · 3 revisions

DynamicObjects.BaseObject

Subclass of DynamicObject but adds methods so that expected static return type from the wrapped interface can be queried.

DynamicObjects.BaseFactory

Functional base class, used to create fluent factories when wrapped in an interface and no boilerplate.

DynamicObjects.Dictionary

Similar to ExpandoObject but is NOT sealed and it can work as a proxy to any IDictionary<string,object>. Also if wrapped in an interface can return default of the static return type when not set. ExpandoObject is performance king, but DynamicObjects.Dictionary offers more flexibility, so use appropriately. (FYI using dynamic calls to ExpandoObject actually are equal/smidge faster than dynamic calls to a POCO object)

DynamicObjects.BaseForwarder

Abstract class forwards methods/properties/indexers to Target. Subclass to do extra work on each call.

DynamicObjects.LateType

Proxy that wraps static methods as instance methods, including the constructor using @new. See LateType

DynamicObjects.Get

Subclass of ImpromptuForwarder. If ActLike is used will coerce result to interface. Works great with anonymous types.

DynamicObjects.Recorder

Records dynamic invocations on to the recorder and can play back invocations on other objects.

DynamicObjects.Mimic

Always returns something you want or returns something with the property you want.

DynamicObjects.ExtensionToInstanceProxy

Proxy that converts Extensions methods to dynamic instance methods.