diff --git a/src/CloudActors.Orleans/CloudActors.Orleans.csproj b/src/CloudActors.Orleans/CloudActors.Orleans.csproj index b296ade..b927ee4 100644 --- a/src/CloudActors.Orleans/CloudActors.Orleans.csproj +++ b/src/CloudActors.Orleans/CloudActors.Orleans.csproj @@ -2,12 +2,12 @@ Devlooped.CloudActors.Orleans - net7.0 + net8.0 - + diff --git a/src/CloudActors.Package/CloudActors.Package.msbuildproj b/src/CloudActors.Package/CloudActors.Package.msbuildproj index acd4825..127a3b0 100644 --- a/src/CloudActors.Package/CloudActors.Package.msbuildproj +++ b/src/CloudActors.Package/CloudActors.Package.msbuildproj @@ -6,7 +6,7 @@ dotnet orleans actor - + diff --git a/src/CloudActors.Streamstone/CloudActors.Streamstone.csproj b/src/CloudActors.Streamstone/CloudActors.Streamstone.csproj index e02322e..d9ec9b5 100644 --- a/src/CloudActors.Streamstone/CloudActors.Streamstone.csproj +++ b/src/CloudActors.Streamstone/CloudActors.Streamstone.csproj @@ -10,14 +10,13 @@ - + - diff --git a/src/CloudActors.Streamstone/StreamstoneSiloBuilderExtensions.cs b/src/CloudActors.Streamstone/StreamstoneSiloBuilderExtensions.cs index d722a71..2028693 100644 --- a/src/CloudActors.Streamstone/StreamstoneSiloBuilderExtensions.cs +++ b/src/CloudActors.Streamstone/StreamstoneSiloBuilderExtensions.cs @@ -7,6 +7,7 @@ using Microsoft.Extensions.Options; using Orleans.Providers; using Orleans.Runtime; +using Orleans.Runtime.Hosting; using Orleans.Storage; namespace Orleans.Hosting; @@ -49,12 +50,7 @@ internal static IServiceCollection AddStreamstoneActorStorage( if (configure is not null) services.AddOptions(name).Configure(configure); - if (string.Equals(name, ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME, StringComparison.Ordinal)) - { - services.TryAddSingleton(sp => sp.GetServiceByName(ProviderConstants.DEFAULT_STORAGE_PROVIDER_NAME)); - } - - return services.AddSingletonNamedService(name, (sp, name) => + return services.AddGrainStorage(name, (sp, name) => { var snapshot = sp.GetRequiredService>(); return new StreamstoneStorage(sp.GetRequiredService(), snapshot.Get(name)); diff --git a/src/CloudActors/CloudActors.csproj b/src/CloudActors/CloudActors.csproj index 9fea2f2..7ca07c7 100644 --- a/src/CloudActors/CloudActors.csproj +++ b/src/CloudActors/CloudActors.csproj @@ -7,7 +7,6 @@ - diff --git a/src/Tests/OrleansTest.cs b/src/Tests/OrleansTest.cs index 1c3d0aa..2e78a2b 100644 --- a/src/Tests/OrleansTest.cs +++ b/src/Tests/OrleansTest.cs @@ -70,11 +70,6 @@ class MemoryStorage : IGrainStorage { ConcurrentDictionary memory = new(); - public MemoryStorage() - { - - } - public Task ClearStateAsync(string stateName, GrainId grainId, IGrainState grainState) => memory.TryRemove(grainId, out _) ? Task.CompletedTask : Task.CompletedTask; diff --git a/src/Tests/Tests.csproj b/src/Tests/Tests.csproj index a9dc590..26c39ec 100644 --- a/src/Tests/Tests.csproj +++ b/src/Tests/Tests.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -8,13 +8,12 @@ - + - - +