public static void RegisterSingleton <TFrom, TTo>(this ISingletonTypeResolverContainer container, params object[] options) { if (container == null) { throw new ArgumentNullException(nameof(container)); } container.RegisterType(typeof(TFrom), new TypeResolverLazy <TTo>(), options); }
public static SingletonBuilder RegisterSingleton(this ISingletonTypeResolverContainer container) { if (container == null) { throw new ArgumentNullException(nameof(container)); } var singleton = new SingletonBuilder(container); return(singleton); }
public static void RegisterSingleton <T>(this ISingletonTypeResolverContainer container, T instance, params object[] options) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (instance == null) { throw new ArgumentNullException(nameof(instance)); } container.RegisterType(typeof(T), instance, options); }
public static void RegisterSingleton(this ISingletonTypeResolverContainer container, Type from, Type to, params object[] options) { if (container == null) { throw new ArgumentNullException(nameof(container)); } if (from == null) { throw new ArgumentNullException(nameof(from)); } if (to == null) { throw new ArgumentNullException(nameof(to)); } container.RegisterType(from, new TypeResolverLazy(to), options); }
public SingletonBuilder(ISingletonTypeResolverContainer container) { Container = container; }