2022-05-27 10:36:39 +00:00
|
|
|
using Elsa.Features.Abstractions;
|
|
|
|
|
using Elsa.Features.Services;
|
2022-12-31 15:16:43 +00:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2022-05-27 10:36:39 +00:00
|
|
|
|
2023-07-17 19:43:35 +00:00
|
|
|
namespace Elsa.Common.Features;
|
2022-05-27 10:36:39 +00:00
|
|
|
|
2023-04-12 19:10:07 +00:00
|
|
|
/// <summary>
|
|
|
|
|
/// Adds and configures the Mediator feature.
|
|
|
|
|
/// </summary>
|
2022-05-27 10:36:39 +00:00
|
|
|
public class MediatorFeature : FeatureBase
|
|
|
|
|
{
|
2023-04-12 19:10:07 +00:00
|
|
|
/// <inheritdoc />
|
2022-05-27 10:36:39 +00:00
|
|
|
public MediatorFeature(IModule module) : base(module)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2023-04-12 19:10:07 +00:00
|
|
|
/// <inheritdoc />
|
2022-05-27 10:36:39 +00:00
|
|
|
public override void Apply()
|
|
|
|
|
{
|
2023-07-17 20:11:41 +00:00
|
|
|
Services
|
|
|
|
|
.AddMediator()
|
|
|
|
|
.AddMediatorHostedServices();
|
2022-05-27 10:36:39 +00:00
|
|
|
}
|
|
|
|
|
}
|