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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Elyfe.Analyzers.Orleans.MartenSchema" Version="0.2.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Elyfe.Analyzers.Orleans.MartenSchema" Version="0.2.2" />
                    
Directory.Packages.props
<PackageReference Include="Elyfe.Analyzers.Orleans.MartenSchema" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Elyfe.Analyzers.Orleans.MartenSchema --version 0.2.2
                    
#r "nuget: Elyfe.Analyzers.Orleans.MartenSchema, 0.2.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Elyfe.Analyzers.Orleans.MartenSchema@0.2.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Elyfe.Analyzers.Orleans.MartenSchema&version=0.2.2
                    
Install as a Cake Addin
#tool nuget:?package=Elyfe.Analyzers.Orleans.MartenSchema&version=0.2.2
                    
Install as a Cake Tool

Elyfe.Orleans.Marten.Persistence

NuGet Version NuGet Downloads

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.2 214 8/21/2025
0.2.1 516 7/10/2025
0.2.0 452 7/7/2025
0.1.3 183 6/28/2025
0.1.2 88 6/28/2025
0.1.1 165 6/26/2025

Initial release.