Exemplo n.º 1
0
        /// <summary>
        /// Creates the default configuration and optionally registers additional application services.
        /// </summary>
        /// <param name="registerServices">An action to register additional services.</param>
        public static DotvvmConfiguration CreateDefault(Action <IServiceCollection> registerServices = null)
        {
            var services = new ServiceCollection();

            DotvvmServiceCollectionExtensions.RegisterDotVVMServices(services);
            registerServices?.Invoke(services);

            return(new ServiceLocator(services).GetService <DotvvmConfiguration>());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates the default configuration and optionally registers additional application services.
        /// </summary>
        /// <param name="registerServices">An action to register additional services.</param>
        public static DotvvmConfiguration CreateDefault(Action <IServiceCollection> registerServices = null)
        {
            var services = new ServiceCollection();

            services.AddOptions();
            var config = CreateDefault(new ServiceLocator(services));

            DotvvmServiceCollectionExtensions.RegisterDotVVMServices(services, config);
            registerServices?.Invoke(services);

            return(config);
        }