Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
<PackageProjectUrl>https://github.com/chronicle-stack/Chronicle.Integrations.MongoDB</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/chronicle-stack/Chronicle/blob/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://avatars1.githubusercontent.com/u/42150754?s=200</PackageIconUrl>
<VersionPrefix>3.1.0</VersionPrefix>
<Version>3.1.0</Version>
<AssemblyVersion>3.1.0</AssemblyVersion>
<FileVersion>3.1.0</FileVersion>
<VersionPrefix>3.1.1</VersionPrefix>
<Version>3.1.1</Version>
<AssemblyVersion>3.1.1</AssemblyVersion>
<FileVersion>3.1.1</FileVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Linq;
using System.Reflection;
using MongoDB.Bson.Serialization.Attributes;

Expand All @@ -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)
{
Expand Down