Elyfe.Analyzers.Orleans.MartenSchema
0.2.2
dotnet add package Elyfe.Analyzers.Orleans.MartenSchema --version 0.2.2
NuGet\Install-Package Elyfe.Analyzers.Orleans.MartenSchema -Version 0.2.2
<PackageReference Include="Elyfe.Analyzers.Orleans.MartenSchema" Version="0.2.2" />
<PackageVersion Include="Elyfe.Analyzers.Orleans.MartenSchema" Version="0.2.2" />
<PackageReference Include="Elyfe.Analyzers.Orleans.MartenSchema" />
paket add Elyfe.Analyzers.Orleans.MartenSchema --version 0.2.2
#r "nuget: Elyfe.Analyzers.Orleans.MartenSchema, 0.2.2"
#:package Elyfe.Analyzers.Orleans.MartenSchema@0.2.2
#addin nuget:?package=Elyfe.Analyzers.Orleans.MartenSchema&version=0.2.2
#tool nuget:?package=Elyfe.Analyzers.Orleans.MartenSchema&version=0.2.2
Elyfe.Orleans.Marten.Persistence
An Orleans 9.x grain persistence provider that uses Marten as a storage backend. This allows you to store your Orleans grain state in a PostgreSQL database with the rich features provided by Marten.
Features
- Marten Integration: Leverages Marten for robust and efficient data persistence in PostgreSQL.
- Full
IGrainStorage
Implementation: Supports reading, writing, and clearing of grain state. - Easy Configuration: Simple
ISiloBuilder
extension methods for quick setup. - Named Provider Support: Configure multiple Marten storage providers with different names.
- Automatic Schema Migrations: Automatically creates and applies database schema changes on startup, ideal for development. For production, it is recommended to use Marten's schema migration tools.
- Schema-per-Provider: Each named provider instance operates within its own database schema, providing strong data isolation.
- Optimistic Concurrency: Generates ETags to support optimistic concurrency control.
Installation
Install the package from NuGet:
Install-Package Elyfe.Orleans.Marten.Persistence
Or via the .NET CLI:
dotnet add package Elyfe.Orleans.Marten.Persistence
Usage
To use the Marten persistence provider, you first need to configure Marten services in your dependency injection container. Then, use the extension methods on ISiloBuilder
to add the grain storage.
var host = new HostBuilder()
.UseOrleans(siloBuilder =>
{
// 1. Configure Marten
siloBuilder.ConfigureServices(services =>
{
services.AddMarten(options =>
{
options.Connection("your-postgres-connection-string");
// Optional: Configure other Marten features
options.Projections.Add<MyProjection>(ProjectionLifecycle.Inline);
});
});
// 2. Add the Marten grain storage provider
// As the default provider
siloBuilder.AddMartenGrainStorageAsDefault();
// Or as a named provider
siloBuilder.AddMartenGrainStorage("MyMartenStore");
})
.Build();
You can then specify which storage provider to use in your grain with the [StorageProvider]
attribute:
[StorageProvider(ProviderName = "MyMartenStore")]
public class MyGrain : Grain<MyGrainState>, IMyGrain
{
// ... grain logic
}
If you registered it as the default, no attribute is needed.
License
This project is licensed under the MIT License.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.CodeAnalysis.CSharp (>= 4.14.0)
- Microsoft.CodeAnalysis.NetAnalyzers (>= 9.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release.