public object Construct(ConstruktionContext context, ConstruktionPipeline pipeline) { var inject = new Foo(); pipeline.Inject(context.RequestType, inject); return(inject); }
public object Construct(ConstruktionContext context, ConstruktionPipeline pipeline) { var method = typeof(A) .GetMethod("Fake", Type.EmptyTypes) .MakeGenericMethod(context.ParameterInfo.ParameterType); var fake = method.Invoke(null, null); pipeline.Inject(context.RequestType, fake); return(fake); }