Guides

Comprehensive guides for using Morphir .NET

Generate model code with the Myriad F# reference, then follow the car rental tutorial through a complete rental and invoice.

Explore our guides to learn how to use Morphir .NET effectively.

Tutorials

Available Guides

  • Configuration - Current support and the planned shared configuration/project system
  • IR Modeling - Learn how to model Morphir IR in .NET
  • Serialization - Working with JSON serialization
  • Testing - Testing strategies and best practices

Best Practices

  • Immutability First: Always prefer immutable data structures
  • ADT Design: Use algebraic data types to make illegal states unrepresentable
  • Type Safety: Leverage C# 14 features for strong typing
  • Testing: Write comprehensive tests using TUnit and Reqnroll

IR Modeling

Learn how to model Morphir IR in .NET

Serialization

Working with JSON serialization in Morphir .NET

Testing

Testing strategies and best practices for Morphir .NET

Tutorial: car rental pricing from F# to C#

Model pricing rules in F#, compile them to Morphir IR, and call them from a C# app

Myriad F# generation reference

Configure classic Morphir JSON generation, module files and diagnostics

Tutorial: compile F# with the native executable

Use the AOT morphir executable and the F# frontend extension, for build agents without the dotnet tool

Myriad System.Text.Json generation

Generate trim-safe System.Text.Json converters and contexts for F# types at build time

Car rental from model to executable F#

Transpile and run inventory, reservation, pickup, return and billing rules