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