Exemple #1
0
 public static void AddInstance(this IContainer c, Type t, object f)
 {
     c.AddInfo(t, new SingletonInfo(() => f));
 }
Exemple #2
0
 public static void AddInfo <T>(this IContainer c, ObjectInfo o)
 {
     c.AddInfo(typeof(T), o);
 }
Exemple #3
0
 public static void AddInstance <TContract>(this IContainer c, TContract f) where TContract : class
 {
     c.AddInfo(typeof(TContract), new SingletonInfo(() => f));
 }
Exemple #4
0
 public static void AddPoolable <TContract>(this IContainer c, Func <TContract> F, int poolsize) where TContract : class
 {
     c.AddInfo(typeof(TContract), new PoolableInfo(F, poolsize));
 }
Exemple #5
0
 public static void AddPoolable(this IContainer c, Type t, Func <object> F, int poolsize)
 {
     c.AddInfo(t, new PoolableInfo(F, poolsize));
 }
Exemple #6
0
 public static void AddTransient(this IContainer c, Type t, Func <object> F)
 {
     c.AddInfo(t, new TransientInfo(F));
 }
Exemple #7
0
 public static void AddTransient <TContract>(this IContainer c, Func <TContract> F) where TContract : class
 {
     c.AddInfo(typeof(TContract), new TransientInfo(F));
 }
Exemple #8
0
 public static void AddScoped(this IContainer c, Type t, Func <object> F)
 {
     c.AddInfo(t, new ScopedInfo(F));
 }
Exemple #9
0
 public static void AddScoped <TContract>(this IContainer c, Func <TContract> F) where TContract : class
 {
     c.AddInfo(typeof(TContract), new ScopedInfo(F));
 }
Exemple #10
0
 public static void AddSingleton(this IContainer c, Type t, Func <object> F)
 {
     c.AddInfo(t, new SingletonInfo(F));
 }