IServiceProvider IShinyStartup.CreateServiceProvider(IServiceCollection services)
        {
            var container = ContainerLocationHelper.LocateContainer(CreateContainerExtension()) ??
                            throw new NullReferenceException("Call PrismContainerExtension.Init() prior to initializing PrismApplication");

            var sp = container.CreateServiceProvider(services);

            var moduleCatalog = container.Resolve <IModuleCatalog>();

            ConfigureModuleCatalog(moduleCatalog);

            if (moduleCatalog.Modules.Any() && moduleCatalog.HasStartupModules(out var startupModules))
            {
                var moduleInitializer = container.Resolve <IModuleInitializer>() as IShinyPrismModuleInitializer;
                moduleInitializer.LoadShinyModules(startupModules);
            }

            return(sp);
        }
 protected override IContainerExtension CreateContainerExtension()
 {
     return(ContainerLocationHelper.LocateContainer() ??
            throw new NullReferenceException("Call PrismContainerExtension.Init() prior to initializing PrismApplication"));
 }