| | | 1 | | using Elsa.Workflows.Runtime; |
| | | 2 | | using Elsa.Workflows.Runtime.Contracts; |
| | | 3 | | using Elsa.Workflows.Runtime.Providers; |
| | | 4 | | |
| | | 5 | | // ReSharper disable once CheckNamespace |
| | | 6 | | namespace Microsoft.Extensions.DependencyInjection; |
| | | 7 | | |
| | | 8 | | /// <summary> |
| | | 9 | | /// Provides extension methods for <see cref="IServiceCollection"/>. |
| | | 10 | | /// </summary> |
| | | 11 | | public static class DependencyInjectionExtensions |
| | | 12 | | { |
| | | 13 | | /// <summary> |
| | | 14 | | /// Adds the specified workflow provider type to the service collection. |
| | | 15 | | /// </summary> |
| | | 16 | | /// <typeparam name="T">The type of the workflow provider to add. Must implement <see cref="IWorkflowsProvider"/>.</ |
| | | 17 | | [Obsolete("Use AddWorkflowsProvider instead.", false)] |
| | 172 | 18 | | public static IServiceCollection AddWorkflowDefinitionProvider<T>(this IServiceCollection services) where T : class, |
| | | 19 | | /// <summary> |
| | | 20 | | /// Registers a <see cref="ITriggerPayloadValidator{TPayload}"/> with the service container. |
| | | 21 | | /// </summary> |
| | | 22 | | /// <param name="services">Service collection</param> |
| | | 23 | | /// <typeparam name="TValidator">Validator of the validator</typeparam> |
| | | 24 | | /// <typeparam name="TPayload">Payload type</typeparam> |
| | | 25 | | public static IServiceCollection AddTriggerPayloadValidator<TValidator, TPayload>(this IServiceCollection services) |
| | | 26 | | where TValidator : class, ITriggerPayloadValidator<TPayload> |
| | | 27 | | { |
| | 172 | 28 | | return services.AddScoped<ITriggerPayloadValidator<TPayload>, TValidator>(); |
| | | 29 | | } |
| | | 30 | | |
| | | 31 | | /// <summary> |
| | | 32 | | /// Adds the specified workflows provider type to the service collection. |
| | | 33 | | /// </summary> |
| | | 34 | | /// <typeparam name="T">The type of the workflow provider to add. Must implement <see cref="IWorkflowsProvider"/>.</ |
| | 15 | 35 | | public static IServiceCollection AddWorkflowsProvider<T>(this IServiceCollection services) where T : class, IWorkflo |
| | | 36 | | } |