Fluent.Unions.Orleans
1.1.0
dotnet add package Fluent.Unions.Orleans --version 1.1.0
NuGet\Install-Package Fluent.Unions.Orleans -Version 1.1.0
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="Fluent.Unions.Orleans" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fluent.Unions.Orleans" Version="1.1.0" />
<PackageReference Include="Fluent.Unions.Orleans" />
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 Fluent.Unions.Orleans --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Fluent.Unions.Orleans, 1.1.0"
#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 Fluent.Unions.Orleans@1.1.0
#: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=Fluent.Unions.Orleans&version=1.1.0
#tool nuget:?package=Fluent.Unions.Orleans&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
![]()
Fluent.Unions.Orleans
Orleans (MIT) serialization for Option<T>, so an option can be a grain argument, a grain result, or part of grain state. A surrogate converter carries the option; results refuse to serialize.
Installation
dotnet add package Fluent.Unions.Orleans
Usage
Register it with the Orleans serializer, in the silo and in every client.
using Fluent.Unions.Orleans;
builder.Services.AddSerializer(serializer => serializer.AddFluentUnions());
Then use Option<T> like any other type.
public interface IUserGrain : IGrainWithStringKey
{
Task<Option<string>> GetNickname();
Task SetNickname(Option<string> nickname);
}
[GenerateSerializer]
public sealed record Profile([property: Id(0)] string Name, [property: Id(1)] Option<string> Nickname);
Documentation
Rules
- Wire format. An option is stored as
OptionSurrogate<T>:HasValue(field 0) andValue(field 1).Noneanddefaultare the same on the wire. - Results throw.
Result,Result<T>and your own result types declared with[FluentResult<TError>]throwNotSupportedExceptionwhen serialized. An error would carry the exception details. Return anOption<T>or a DTO from a grain, or let the grain throw: Orleans carries exceptions by itself. - Code generation. The Orleans code generator only sees the surrogate struct, so it does not depend on how C# 15 unions are compiled. AOT and trimming are not tested.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net11.0
- Fluent.Unions (>= 1.1.0)
- Microsoft.Orleans.Serialization (>= 10.4.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.