public void Configure(Type type, ComponentCallModelEnum callModel) { switch (callModel) { case ComponentCallModelEnum.Singleton: _resolvers[type] = new SingletonResolver(type, _container, Build); _container.Register.Type(type).AsSingleton(); break; case ComponentCallModelEnum.Singlecall: _resolvers[type] = new TransientResolver(type, _container, Build); _container.Register.Type(type).AsTransient(); break; default: throw new ArgumentException(); } }
public void RegisterSingleton(Type lookupType, object instance) { _resolvers[lookupType] = new SingletonResolver(lookupType, _container, Build); _container.Register.Type(lookupType).Is(instance); }