Fix MongoDb (#540)
This commit is contained in:
parent
f6685189f7
commit
79b5b89505
|
|
@ -20,7 +20,7 @@ namespace Elsa.Models
|
|||
Data = data;
|
||||
}
|
||||
|
||||
public string? TenantId { get; }
|
||||
public string? TenantId { get; private set; }
|
||||
public string WorkflowInstanceId { get; set; } = default!;
|
||||
public string ActivityId { get; set; } = default!;
|
||||
public Instant Timestamp { get; set; }= default!;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using Elsa.Models;
|
||||
using Elsa.Persistence.MongoDb.Serializers;
|
||||
using MongoDb.Bson.NodaTime;
|
||||
|
|
@ -22,22 +23,25 @@ namespace Elsa.Persistence.MongoDb.Services
|
|||
|
||||
private static bool Map()
|
||||
{
|
||||
if (BsonClassMap.IsClassMapRegistered(typeof(WorkflowDefinition)))
|
||||
if (BsonClassMap.IsClassMapRegistered(typeof(Entity)))
|
||||
return false;
|
||||
|
||||
try
|
||||
{
|
||||
BsonClassMap.RegisterClassMap<Entity>(cm =>
|
||||
{
|
||||
cm.SetIsRootClass(true);
|
||||
cm.MapIdProperty(x => x.Id);
|
||||
});
|
||||
|
||||
BsonClassMap.RegisterClassMap<WorkflowDefinition>(cm =>
|
||||
{
|
||||
cm.AutoMap();
|
||||
cm.MapIdMember(x => x.Id);
|
||||
cm.AutoMap();
|
||||
});
|
||||
|
||||
BsonClassMap.RegisterClassMap<WorkflowInstance>(cm =>
|
||||
{
|
||||
cm.AutoMap();
|
||||
cm.MapIdMember(x => x.Id);
|
||||
cm.AutoMap();
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue