orleans-result-pattern

Signal Orleans grain call failures with Result and Result<T> wrappers.

7|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/VincentH-Net/dotnet-agentic-engineering --skill orleans-result-pattern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: orleans-result-pattern
Source: https://github.com/VincentH-Net/dotnet-agentic-engineering/tree/main/plugins/orleans/skills/orleans-result-pattern
Command: npx skills add https://github.com/VincentH-Net/dotnet-agentic-engineering --skill orleans-result-pattern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

The Orleans Result Pattern solves the challenge of signaling grain-method failures without exceptions, using a version-tolerant enum-based error model that serializes cleanly across grain boundaries.

Core Features & Use Cases

  • Provides Result and Result<T> wrappers with an enum ErrorNr and string error messages for predictable, exception-free failure flows.
  • Enables easy integration with ASP.NET Core minimal APIs and MVC endpoints on top of Orleans grains.
  • Supports RFC7807-compatible validation and error reporting when ErrorNr is annotated with a ValidationError flag.

Quick Start

Define a grain contract that returns Result<string> and a client that handles success and error branches using a switch expression.

Frequently Asked Questions about orleans-result-pattern

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I signal failure in Orleans grain calls without throwing exceptions?

To signal failure in Orleans grain calls without exceptions, use a Result pattern with enum-based ErrorNr and string messages. This approach provides version-tolerant serialization across grain boundaries using [Immutable] wrappers for zero-copy grain calls.

Does the Orleans result pattern support version-tolerant serialization across grain boundaries?

Yes, the Orleans result pattern supports version-tolerant serialization by using an enum-based error model and [Immutable] wrappers. This ensures clean zero-copy serialization across grain boundaries without breaking compatibility during contract updates.

How do I return RFC7807-compatible validation errors from ASP.NET Core endpoints over Orleans grains?

To return RFC7807-compatible errors from ASP.NET Core endpoints over Orleans grains, annotate ErrorNr with a ValidationError flag. The result pattern integrates with minimal APIs and MVC endpoints to report validation failures predictably.

Can I use this result pattern with Orleans 8+ grain contracts and minimal APIs?

Yes, you can use this result pattern with Orleans 8+ grain contracts and ASP.NET Core minimal APIs. It provides Result and Result<T> wrappers that enable explicit success and error branch handling through switch expressions in client code.

Do I need Modern.CSharp.Templates to generate ErrorNr and Result types for Orleans grains?

Yes, you need Modern.CSharp.Templates to generate ErrorNr and Result types for Orleans grains. The Orleans result pattern requires these templates alongside Orleans 8+ to produce the immutable serialization-safe contract structures.

What's the best way to handle Orleans grain method failures instead of throwing exceptions?

The best way to handle Orleans grain method failures without exceptions is using an enum-based Result pattern. Unlike throwing exceptions across grain boundaries, this pattern offers predictable failure flows, version-tolerant serialization, and explicit Result<T> semantics.