public object GetInstance(ServiceRequest serviceRequest) { CallCount++; ServiceName = serviceRequest.ServiceName; return serviceRequest.CanProceed ? serviceRequest.Proceed() : new Bar(); }
private IFoo CreateInstance(ServiceRequest serviceRequest) { return (IFoo)serviceRequest.Proceed(); }