using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; namespace Elsa.Features.Services; /// /// A thin abstraction on top of to help organize features and dependencies. /// public interface IModule { /// /// The service collection being populated. /// IServiceCollection Services { get; } /// /// A dictionary into which features can stash away values for later use. /// IDictionary Properties { get; } /// /// Returns true if a feature of the specified type has been configured. /// bool HasFeature() where T : class, IFeature; /// /// Returns true if a feature of the specified type has been configured. /// bool HasFeature(Type featureType); /// /// Creates and configures a feature of the specified type. /// T Configure(Action? configure = null) where T : class, IFeature; /// /// Creates and configures a feature of the specified type. /// T Configure(Func factory, Action? configure = null) where T : class, IFeature; /// /// Configures a using an optional priority to control in which order it will be registered with the service container. /// IModule ConfigureHostedService(int priority = 0) where T : class, IHostedService; /// /// Configures a using an optional priority to control in which order it will be registered with the service container. /// IModule ConfigureHostedService(Type hostedServiceType, int priority = 0); /// /// Will apply all configured features, causing the collection to be populated. /// void Apply(); }