Ejemplo n.º 1
0
 public static void AddSingleton <T1>(this IMyServiceCollection services)
 {
     serviceTypes.Add(typeof(T1), MyServiceDescriptor.Singleton(typeof(T1)));
 }
Ejemplo n.º 2
0
 public static void AddSingleton <T1, T2>(this IMyServiceCollection services) where T2 : T1
 {
     serviceTypes.Add(typeof(T1), MyServiceDescriptor.Singleton(typeof(T2)));
 }
Ejemplo n.º 3
0
 static MyServiceExtension()
 {
     serviceTypes.Add(typeof(IMyServiceProvider), MyServiceDescriptor.Singleton(new MyServiceProvider()));
 }