Ejemplo n.º 1
0
        private static void LoadExtensions(RazorProjectEngineBuilder builder, IReadOnlyList <RazorExtension> extensions)
        {
            for (var i = 0; i < extensions.Count; i++)
            {
                // For now we only handle AssemblyExtension - which is not user-constructable. We're keeping a tight
                // lid on how things work until we add official support for extensibility everywhere. So, this is
                // intentionally inflexible for the time being.
                if (extensions[i] is AssemblyExtension extension)
                {
                    var initializer = extension.CreateInitializer();
                    initializer?.Initialize(builder);
                }
            }

            // Default extensions.
            ComponentExtensions.Register(builder);
        }