using LightInject; namespace Umbraco.Core.Components { /// /// Represents a composition. /// /// Although a composition exposes the application's service container, people should use the /// extension methods (such as PropertyEditors() or SetPublishedContentModelFactory()) and /// avoid accessing the container. This is because everything needs to be properly registered and with /// the proper lifecycle. These methods will take care of it. Directly registering into the container /// may cause issues. public class Composition { /// /// Initializes a new instance of the class. /// /// A container. /// The runtime level. public Composition(IServiceContainer container, RuntimeLevel level) { Container = container; RuntimeLevel = level; } /// /// Gets the container. /// /// Use with care! public IServiceContainer Container { get; } /// /// Gets the runtime level. /// public RuntimeLevel RuntimeLevel { get; } } }