Skip to content

Add lightweight C# Result pipeline sample - #17

Merged
balajibashyam merged 3 commits into
mainfrom
feature/result-pipeline-sample
Aug 5, 2026
Merged

Add lightweight C# Result pipeline sample#17
balajibashyam merged 3 commits into
mainfrom
feature/result-pipeline-sample

Conversation

@balajibashyam

Copy link
Copy Markdown
Contributor

Summary

Adds a minimal .NET 10 companion sample for the C# 12 Functional Patterns: Result Type, Error Handling & Composable Pipeline Testing tutorial.

What's included

  • New sample: csharp-language/modern-patterns-result-pipeline/ — 14 files

    • Educational Result<T> hierarchy with Success/Failure cases
    • Public and diagnostic error projections (ToPublic/ToDiagnostic)
    • Map, Bind, Match, and BindAsync composition
    • Restricted comma-delimited parser with exact header, quote rejection, and malformed-row aggregation
    • Invariant-culture collect-all validation
    • Pure name-normalization transformation
    • Deterministic in-memory persistence with configurable rejection
    • Short-circuit behavior (parse/validation failures skip persistence)
    • Caller cancellation propagation without writes
    • C# 12.0 lock with explicit fallback arms in all switch expressions
    • Deterministic console output (five lines)
    • 10 xUnit v3 tests
  • Root README: New sample row in the table + updated repository structure

  • GitHub Actions: New test-result-pipeline job in the shared workflow; path filters updated

Deliberately omitted (stays in the full tutorial)

Third-party Result packages, FluentAssertions, structured logging, databases, ASP.NET Core, full CSV, partial success, retries, exception swallowing

Versions

  • .NET SDK: 10.0.302
  • Application NuGet dependencies: none
  • Microsoft.NET.Test.Sdk: 18.8.1
  • xunit.v3: 3.2.2
  • xunit.runner.visualstudio: 3.1.5

Validation

  • dotnet restore — passed
  • dotnet build --configuration Release — passed (0 errors, 0 warnings)
  • dotnet test --configuration Release — passed (10/10)
  • Security scan — clean

Commits

  1. Add lightweight C# Result pipeline sample
  2. Add Result pipeline sample to repository README
  3. Test Result pipeline sample in GitHub Actions

@balajibashyam
balajibashyam merged commit f6b7e4e into main Aug 5, 2026
19 checks passed
@balajibashyam
balajibashyam deleted the feature/result-pipeline-sample branch August 5, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant