elsa-core/src/common
Sipke Schoorstra 1a554e7e06
Fix MongoDB serialization issues (#6762)
* Ongoing MongoDB work

* Refactor MongoDB serializer configuration and improve type handling

- Added `BsonSerializerHelpers` for streamlined serializer registration with error handling.
- Introduced `ConfigureMongoDbSerializers` hosted service to centralize serializer setup.
- Enhanced `FlowScopeSerializer` to handle additional BSON types.
- Cleaned up and reorganized MongoDB feature implementations, removing redundant code and improving consistency.

* Remove `BsonSerializerHelpers` and update MongoDB serializer registration

- Deleted `BsonSerializerHelpers` as it was redundant.
- Updated `ConfigureMongoDbSerializers` to directly register serializers using `BsonSerializer`.
- Simplified `FlowScopeSerializer` null handling for improved readability.

* Switch persistence provider to Entity Framework Core in `Program.cs`.

* Update src/modules/Elsa.MongoDb/Serializers/FlowScopeSerializer.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Configures MongoDB services and options.

Configures MongoDB services, including client and database creation.

Registers default naming strategy and collection naming strategy.

Adds BsonClassMap configuration for KeyValuePair.

* Simplify null check in `FlowScopeSerializer`.

* Allow `FlowScopeSerializer` to handle nullable `FlowScope`.

* Registers FlowScope BSON class map

Registers the `FlowScope` class with BSON to enable proper serialization and deserialization of workflow scopes within MongoDB.

This ensures that workflow scopes, which are used to manage variables within a workflow, are correctly stored and retrieved from the database.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-04 09:46:20 +02:00
..
Elsa.Api.Common Implement multitenant HTTP routing (#6031) 2024-10-14 21:27:11 +02:00
Elsa.DropIns Enh/5943 DropIns - Prevention of File Locks and Unloading (#5944) 2024-09-05 18:09:31 +02:00
Elsa.DropIns.Core Enh/5943 DropIns - Prevention of File Locks and Unloading (#5944) 2024-09-05 18:09:31 +02:00
Elsa.Features Fix MongoDB serialization issues (#6762) 2025-07-04 09:46:20 +02:00
Elsa.Mediator Enhances Mediator with Tenant Context Propagation (#6738) 2025-06-13 14:26:51 +02:00
Elsa.Testing.Shared Update project reference path for Elsa module 2024-07-24 14:11:29 +02:00
Elsa.Testing.Shared.Component Call async methods when in an async method 2024-12-16 22:57:11 +03:00
Elsa.Testing.Shared.Integration Fix Output Persistence of Async Activities (#6542) 2025-04-01 07:53:00 +02:00