using Elsa.Features.Implementations; using Elsa.Features.Services; using Microsoft.Extensions.DependencyInjection; // ReSharper disable once CheckNamespace namespace Elsa.Extensions; /// /// Adds extension methods to that creates and configures modules. /// public static class DependencyInjectionExtensions { /// /// Returns a new instance of an implementation. /// public static IModule CreateModule(this IServiceCollection services) => new Module(services); /// /// Installs and configures the specified feature. If the feature was already installed, it is not added twice, which means it is safe to call this method multiple times. /// public static IModule Use(this IModule module, Action? configure = null) where T: class, IFeature { module.Configure(configure); return module; } }