Connected properties only allow attaching data
to carrier objects, but you may attach a delegate as data. It can then be used as a connected method.
This is similar to setting delegates on an ExpandoObject.
private const string LogMethod = Guid.NewGuid().ToString("N");
public void Log(object obj)
var logMethodProperty = PropertyConnector.Default.Get(obj, LogMethod);
if (logMethodProperty.TryGet(out logMethod))
// This instance has a connected Log method.
// This instance does not have a connected Log method.
Note that connected methods are different than extension methods. Extension methods extend a
, and can be called for any instance of that type. Connected methods extend an
, so they can be overridden on a per-instance basis.