File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/providers/WorkflowCore.Persistence.MongoDB/Services Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 5
5
using System . Collections . Generic ;
6
6
using System . Linq ;
7
7
using System . Threading . Tasks ;
8
+ using MongoDB . Bson ;
9
+ using MongoDB . Bson . Serialization . Conventions ;
8
10
using MongoDB . Driver . Linq ;
9
11
using WorkflowCore . Interface ;
10
12
using WorkflowCore . Models ;
@@ -24,6 +26,13 @@ public MongoPersistenceProvider(IMongoDatabase database)
24
26
25
27
static MongoPersistenceProvider ( )
26
28
{
29
+ ConventionRegistry . Register (
30
+ "workflow.conventions" ,
31
+ new ConventionPack
32
+ {
33
+ new EnumRepresentationConvention ( BsonType . String )
34
+ } , t => t . FullName ? . StartsWith ( "WorkflowCore" ) ?? false ) ;
35
+
27
36
BsonClassMap . RegisterClassMap < WorkflowInstance > ( x =>
28
37
{
29
38
x . MapIdProperty ( y => y . Id )
You can’t perform that action at this time.
0 commit comments