Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Commit

Permalink
Fixed type in mongo saga state
Browse files Browse the repository at this point in the history
  • Loading branch information
GooRiOn committed Aug 20, 2020
1 parent 5e94162 commit fc1ae7f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
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

0 comments on commit fc1ae7f

Please sign in to comment.