| | | 1 | | using Elsa.Features.Services; |
| | | 2 | | using Elsa.Tenants.Features; |
| | | 3 | | using JetBrains.Annotations; |
| | | 4 | | |
| | | 5 | | // ReSharper disable once CheckNamespace |
| | | 6 | | namespace Elsa.Tenants.Extensions; |
| | | 7 | | |
| | | 8 | | /// <summary> |
| | | 9 | | /// Extensions for <see cref="IModule"/> that installs the <see cref="TenantsFeature"/> feature. |
| | | 10 | | /// </summary> |
| | | 11 | | [UsedImplicitly] |
| | | 12 | | public static class ModuleExtensions |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// Installs and configures the <see cref="TenantsFeature"/> feature. |
| | | 16 | | /// </summary> |
| | | 17 | | [UsedImplicitly] |
| | | 18 | | public static IModule UseTenants(this IModule module, Action<TenantsFeature>? configure = null) |
| | | 19 | | { |
| | 14 | 20 | | module.Configure(configure); |
| | 14 | 21 | | return module; |
| | | 22 | | } |
| | | 23 | | |
| | | 24 | | extension(TenantsFeature feature) |
| | | 25 | | { |
| | | 26 | | /// <summary> |
| | | 27 | | /// Installs and configures the <see cref="TenantManagementEndpointsFeature"/> feature. |
| | | 28 | | /// </summary> |
| | | 29 | | [UsedImplicitly] |
| | | 30 | | public TenantsFeature UseTenantManagementEndpoints(Action<TenantManagementEndpointsFeature>? configure = null) |
| | | 31 | | { |
| | 0 | 32 | | feature.Module.Configure(configure); |
| | 0 | 33 | | return feature; |
| | | 34 | | } |
| | | 35 | | |
| | | 36 | | /// <summary> |
| | | 37 | | /// Installs and configures the <see cref="TenantManagementFeature"/> feature. |
| | | 38 | | /// </summary> |
| | | 39 | | [UsedImplicitly] |
| | | 40 | | public TenantsFeature UseTenantManagement(Action<TenantManagementFeature>? configure = null) |
| | | 41 | | { |
| | 0 | 42 | | feature.Module.Configure(configure); |
| | 0 | 43 | | return feature; |
| | | 44 | | } |
| | | 45 | | } |
| | | 46 | | } |