Exemplo n.º 1
0
 public static void AddDependencyWithInstance <I>(I objectInstance)
 {
     if (!dependencies.ContainsKey(typeof(I)))
     {
         dependencies.Add(typeof(I), new DependencyInfo()
         {
             Interface = typeof(I), ConcreteType = typeof(I), instance = objectInstance
         });
     }
     else
     {
         dependencies[typeof(I)] = new DependencyInfo()
         {
             Interface = typeof(I), ConcreteType = typeof(I), instance = objectInstance
         }
     };
 }
Exemplo n.º 2
0
 public static void AddDependency <I, C>(params object[] arguments)
 {
     if (!dependencies.ContainsKey(typeof(I)))
     {
         dependencies.Add(typeof(I), new DependencyInfo()
         {
             Interface = typeof(I), ConcreteType = typeof(C), args = arguments
         });
     }
     else
     {
         dependencies[typeof(I)] = new DependencyInfo()
         {
             Interface = typeof(I), ConcreteType = typeof(C), args = arguments
         }
     };
 }