protected override object build(Type pluginType, BuildSession session) { // Find the first InstanceCase that matches the BuildSession/IContext InstanceCase instanceCase = _cases.Find(c => c.Predicate(session)); // Use the Instance from the InstanceCase if it exists, // otherwise, use the "default" Instance instance = instanceCase == null ? _default : instanceCase.Instance; // delegate to the chosen Instance return(instance.Build(pluginType, session)); }
public object ConstructNew(Type pluginType, Instance instance, BuildSession session) { object returnValue = instance.Build(pluginType, session); return ApplyInterception(pluginType, returnValue, session, instance); }
public object ConstructNew(Type pluginType, Instance instance, BuildSession session) { object returnValue = instance.Build(pluginType, session); return(ApplyInterception(pluginType, returnValue, session, instance)); }