| | | 1 | | using Elsa.Alterations.AlterationHandlers; |
| | | 2 | | using Elsa.Alterations.AlterationTypes; |
| | | 3 | | using Elsa.Alterations.Core.Extensions; |
| | | 4 | | using Elsa.Alterations.Features; |
| | | 5 | | using Microsoft.Extensions.DependencyInjection; |
| | | 6 | | |
| | | 7 | | namespace Elsa.Alterations.Extensions; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Extension methods for <see cref="IServiceCollection"/>. |
| | | 11 | | /// </summary> |
| | | 12 | | public static class ServiceCollectionExtensions |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// Adds various alteration handlers. |
| | | 16 | | /// </summary> |
| | | 17 | | public static IServiceCollection AddAlterations(this IServiceCollection services) |
| | | 18 | | { |
| | 2 | 19 | | services.AddAlteration<Migrate, MigrateHandler>(); |
| | 2 | 20 | | services.AddAlteration<ModifyVariable, ModifyVariableHandler>(); |
| | 2 | 21 | | services.AddAlteration<ScheduleActivity, ScheduleActivityHandler>(); |
| | 2 | 22 | | services.AddAlteration<CancelActivity, CancelActivityHandler>(); |
| | 2 | 23 | | services.AddAlteration<Cancel, CancelHandler>(); |
| | 2 | 24 | | services.AddNotificationHandlersFrom<AlterationsFeature>(); |
| | 2 | 25 | | return services; |
| | | 26 | | } |
| | | 27 | | } |