BuildIt.Lifecycle.BaseApplication.Startup C# (CSharp) Method

Startup() public method

public Startup ( ServiceLocatorProvider locatorProvider, IDependencyContainer container, Action buildDependencies = null ) : System.Threading.Tasks.Task
locatorProvider ServiceLocatorProvider
container IDependencyContainer
buildDependencies Action
return System.Threading.Tasks.Task
        public async Task Startup(ServiceLocatorProvider locatorProvider,
            IDependencyContainer container,
            Action<IDependencyContainer> buildDependencies = null)
        {
            await CommenceStartup();

            //            var builder = new ContainerBuilder();

            using (container.StartUpdate())
            {
                // Build and application dependencies
                RegisterDependencies(container);

                buildDependencies?.Invoke(container);

                //// Perform registrations and build the container.
                //var container = builder.Build();

                await BuildCoreDependencies(container);
            }

            // Set the service locator to an AutofacServiceLocator.
            //var csl = new AutofacServiceLocator(container);
            //ServiceLocator.SetLocatorProvider(() => csl);
            ServiceLocator.SetLocatorProvider(locatorProvider);

            await CompleteStartup();
        }