Files
Umbraco-CMS/src/Umbraco.Core/Sections/SectionCollectionBuilder.cs
Shannon df9c4a0160 Adds bundle options to the package manifest
to more control over how bundling works for static file processing for app_plugins
2021-07-15 13:26:32 -06:00

25 lines
987 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Manifest;
namespace Umbraco.Cms.Core.Sections
{
public class SectionCollectionBuilder : OrderedCollectionBuilderBase<SectionCollectionBuilder, SectionCollection, ISection>
{
protected override SectionCollectionBuilder This => this;
protected override IEnumerable<ISection> CreateItems(IServiceProvider factory)
{
// get the manifest parser just-in-time - injecting it in the ctor would mean that
// simply getting the builder in order to configure the collection, would require
// its dependencies too, and that can create cycles or other oddities
var manifestParser = factory.GetRequiredService<IManifestParser>();
return base.CreateItems(factory).Concat(manifestParser.CombinedManifest.Sections);
}
}
}