Skip to content

Commit

Permalink
Merge pull request #433 from alrz/use-typemanifestoptions
Browse files Browse the repository at this point in the history
Minor refactoring atop of #430
  • Loading branch information
richorama authored Nov 11, 2024
2 parents ef58c7a + 956dcf6 commit 9df7e57
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 2 additions & 1 deletion OrleansDashboard/Implementation/Grains/DashboardGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ public async Task<Immutable<string>> GetGrainState(string id, string grainType)

try
{
var implementationType = GrainStateHelper.GetGrainType(grainType, typeManifestOptions);
var implementationType = typeManifestOptions.InterfaceImplementations
.FirstOrDefault(w => w.FullName.Equals(grainType));

var mappedGrainId = GrainStateHelper.GetGrainId(id, implementationType);
object grainId = mappedGrainId.Item1;
Expand Down
7 changes: 0 additions & 7 deletions OrleansDashboard/Implementation/Helpers/GrainStateHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Orleans.Serialization.Configuration;

namespace OrleansDashboard.Implementation.Helpers
{
Expand Down Expand Up @@ -92,11 +91,5 @@ public static MethodInfo GenerateGetGrainMethod(IGrainFactory grainFactory, obje
&& w.GetParameters()[2].ParameterType == typeof(string));
}
}

public static Type GetGrainType(string grainType, TypeManifestOptions typeManifestOptions)
{
return typeManifestOptions.InterfaceImplementations
.FirstOrDefault(w => w.FullName.Equals(grainType));
}
}
}

0 comments on commit 9df7e57

Please sign in to comment.