| | | 1 | | using Elsa.Features.Attributes; |
| | | 2 | | using Elsa.Features.Services; |
| | | 3 | | using Elsa.Persistence.EFCore; |
| | | 4 | | using Elsa.UserTasks.Contracts; |
| | | 5 | | using Elsa.UserTasks.Features; |
| | | 6 | | using Elsa.UserTasks.Persistence.EFCore.Contracts; |
| | | 7 | | using Elsa.UserTasks.Persistence.EFCore.Repositories; |
| | | 8 | | using Microsoft.Extensions.DependencyInjection; |
| | | 9 | | |
| | | 10 | | namespace Elsa.UserTasks.Persistence.EFCore.Features; |
| | | 11 | | |
| | | 12 | | /// <summary> |
| | | 13 | | /// Configures the identity-neutral User Tasks repository with EF Core persistence. |
| | | 14 | | /// </summary> |
| | | 15 | | [DependsOn(typeof(UserTasksFeature))] |
| | | 16 | | public class EFCoreUserTasksPersistenceFeature(IModule module) |
| | 0 | 17 | | : PersistenceFeatureBase<EFCoreUserTasksPersistenceFeature, UserTasksElsaDbContext>(module) |
| | | 18 | | { |
| | | 19 | | public override void Apply() |
| | | 20 | | { |
| | 0 | 21 | | base.Apply(); |
| | 0 | 22 | | AddStore<UserTaskRecord, EFCoreUserTaskRepository>(); |
| | 0 | 23 | | AddStore<UserTaskGuestSessionRecord, EFCoreUserTaskGuestSessionIssuer>(); |
| | 0 | 24 | | AddStore<UserTaskInvitationDeliveryRecord, EFCoreUserTaskInvitationOutbox>(); |
| | 0 | 25 | | Services.AddScoped<IUserTaskRepository, EFCoreUserTaskRepository>(); |
| | 0 | 26 | | Services.AddScoped<IUserTaskPersistenceAdapter, EFCoreUserTaskRepository>(); |
| | | 27 | | |
| | | 28 | | // Guest sessions and invitation deliveries carry secrets that must survive a restart and a |
| | | 29 | | // failover, so the provider replaces the Core in-memory defaults registered by TryAdd. |
| | 0 | 30 | | Services.AddScoped<IUserTaskGuestSessionIssuer, EFCoreUserTaskGuestSessionIssuer>(); |
| | 0 | 31 | | Services.AddScoped<IUserTaskInvitationOutbox, EFCoreUserTaskInvitationOutbox>(); |
| | 0 | 32 | | } |
| | | 33 | | } |