示例#1
0
        // Use this method to add services directly to LightInject
        // Important: This method must exist in order to replace the default provider.
        public void ConfigureContainer(IServiceContainer container)
        {
            //configure our IoC container
            ContainerManager.Bootstrap(container);

            ConfigureApplicationWithContainer(container);
        }
        static void Main(string[] args)
        {
            var container = new ServiceContainer();

            ContainerManager.Bootstrap(container);
            using (var scope = container.BeginScope())
            {
                var unitOfWork = container.GetInstance <IUnitOfWork>();
            }
        }
示例#3
0
 public void Initialize()
 {
     ContainerManager.Bootstrap();
     ServiceFactory = ContainerManager.Container.BeginScope();
 }