| | | 1 | | using Elsa.Features.Attributes; |
| | | 2 | | using Elsa.Features.Services; |
| | | 3 | | using Elsa.Persistence.EFCore; |
| | | 4 | | using Elsa.Secrets.Contracts; |
| | | 5 | | using Elsa.Secrets.Features; |
| | | 6 | | using Elsa.Secrets.Models; |
| | | 7 | | using Elsa.Secrets.Persistence.EFCore.Repositories; |
| | | 8 | | using Elsa.Secrets.Services; |
| | | 9 | | using Microsoft.Extensions.DependencyInjection; |
| | | 10 | | using Microsoft.Extensions.DependencyInjection.Extensions; |
| | | 11 | | |
| | | 12 | | namespace Elsa.Secrets.Persistence.EFCore.Features; |
| | | 13 | | |
| | | 14 | | /// <summary> |
| | | 15 | | /// Configures the <see cref="SecretsFeature"/> feature with Entity Framework Core persistence. |
| | | 16 | | /// </summary> |
| | | 17 | | [DependsOn(typeof(SecretsFeature))] |
| | 0 | 18 | | public class EFCoreSecretsPersistenceFeature(IModule module) : PersistenceFeatureBase<EFCoreSecretsPersistenceFeature, S |
| | | 19 | | { |
| | | 20 | | /// <inheritdoc /> |
| | | 21 | | public override void Apply() |
| | | 22 | | { |
| | 0 | 23 | | base.Apply(); |
| | 0 | 24 | | AddStore<Secret, EFCoreSecretRepository>(); |
| | 0 | 25 | | Services.AddScoped<ISecretRepository, EFCoreSecretRepository>(); |
| | 0 | 26 | | Services.Replace(ServiceDescriptor.Describe(typeof(DefaultSecretManager), typeof(DefaultSecretManager), ServiceL |
| | 0 | 27 | | Services.Replace(ServiceDescriptor.Scoped<ISecretManager>(sp => sp.GetRequiredService<DefaultSecretManager>())); |
| | 0 | 28 | | Services.Replace(ServiceDescriptor.Scoped<IManagedSecretManager>(sp => sp.GetRequiredService<DefaultSecretManage |
| | 0 | 29 | | Services.Replace(ServiceDescriptor.Scoped<ISecretResolver, DefaultSecretResolver>()); |
| | 0 | 30 | | } |
| | | 31 | | } |