public Incubator Returns <T>(Func <Incubator, T> instanciator) { Incubator inc = Incubator ?? new Incubator(); inc.Set <T>(() => instanciator(inc)); return(inc); }
/// <summary> /// Specify the return type T for the specified /// type I ( same as To ) /// </summary> /// <typeparam name="T"></typeparam> /// <returns></returns> public Incubator Returns <T>() { Incubator inc = Incubator ?? new Incubator(); inc.Set(typeof(I), inc.Construct(typeof(T))); return(inc); }
public Incubator Returns <T>(Func <T> instanciator) { Incubator inc = Incubator ?? new Incubator(); inc.Set(instanciator, false); return(inc); }
public Incubator Returns(object instance) { Incubator inc = Incubator ?? new Incubator(); inc.Set(typeof(I), instance); return(inc); }