| | | 1 | | using Elsa.Features.Services; |
| | | 2 | | using Elsa.WorkflowProviders.BlobStorage.Features; |
| | | 3 | | using FluentStorage.Blobs; |
| | | 4 | | using JetBrains.Annotations; |
| | | 5 | | |
| | | 6 | | // ReSharper disable once CheckNamespace |
| | | 7 | | namespace Elsa.Extensions; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Extension methods for <see cref="IModule"/> to add the fluent storage workflow definition provider. |
| | | 11 | | /// </summary> |
| | | 12 | | [PublicAPI] |
| | | 13 | | public static class ModuleExtensions |
| | | 14 | | { |
| | | 15 | | /// <summary> |
| | | 16 | | /// Adds the fluent storage workflow definition provider. |
| | | 17 | | /// </summary> |
| | | 18 | | /// <param name="module">The module.</param> |
| | | 19 | | /// <param name="blobStorage">A callback that creates an <see cref="IBlobStorage"/>.</param> |
| | | 20 | | /// <returns>The module.</returns> |
| | | 21 | | public static IModule UseFluentStorageProvider(this IModule module, Func<IServiceProvider, IBlobStorage> blobStorage |
| | | 22 | | { |
| | 2 | 23 | | return module.UseFluentStorageProvider(feature => feature.BlobStorage = blobStorage); |
| | | 24 | | } |
| | | 25 | | |
| | | 26 | | /// <summary> |
| | | 27 | | /// Adds the fluent storage workflow definition provider. |
| | | 28 | | /// </summary> |
| | | 29 | | /// <param name="module">The module.</param> |
| | | 30 | | /// <param name="configure">The configuration delegate.</param> |
| | | 31 | | /// <returns>The module.</returns> |
| | | 32 | | public static IModule UseFluentStorageProvider(this IModule module, Action<BlobStorageFeature>? configure = null) |
| | | 33 | | { |
| | 2 | 34 | | module.Use(configure); |
| | 2 | 35 | | return module; |
| | | 36 | | } |
| | | 37 | | } |