diff --git a/src/Chronicle.Integrations.MongoDB/src/Chronicle.Integrations.MongoDB.csproj b/src/Chronicle.Integrations.MongoDB/src/Chronicle.Integrations.MongoDB.csproj index ba633bb..8954157 100644 --- a/src/Chronicle.Integrations.MongoDB/src/Chronicle.Integrations.MongoDB.csproj +++ b/src/Chronicle.Integrations.MongoDB/src/Chronicle.Integrations.MongoDB.csproj @@ -11,10 +11,10 @@ https://github.com/chronicle-stack/Chronicle.Integrations.MongoDB https://github.com/chronicle-stack/Chronicle/blob/master/LICENSE https://avatars1.githubusercontent.com/u/42150754?s=200 - 3.1.0 - 3.1.0 - 3.1.0 - 3.1.0 + 3.1.1 + 3.1.1 + 3.1.1 + 3.1.1 diff --git a/src/Chronicle.Integrations.MongoDB/src/Persistence/MongoSagaState.cs b/src/Chronicle.Integrations.MongoDB/src/Persistence/MongoSagaState.cs index bd8191b..31bcb7c 100644 --- a/src/Chronicle.Integrations.MongoDB/src/Persistence/MongoSagaState.cs +++ b/src/Chronicle.Integrations.MongoDB/src/Persistence/MongoSagaState.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using System.Reflection; using MongoDB.Bson.Serialization.Attributes; @@ -15,7 +16,12 @@ internal class MongoSagaState : ISagaState public string SagaType { get; set; } public SagaStates State { get; set; } public object Data { get; set; } - Type ISagaState.Type => Assembly.GetEntryAssembly()?.GetType(SagaType); + + Type ISagaState.Type => _type ??= AppDomain.CurrentDomain.GetAssemblies() + .Select(a => a.GetType(SagaType)) + .FirstOrDefault(t => t is {}); + + private Type _type; public void Update(SagaStates state, object data = null) {