entity-framework-fsharp

Map F# value objects and discriminated unions between JSON and EF Core.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/wonderlydotcom/freetool --skill entity-framework-fsharp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: entity-framework-fsharp
Source: https://github.com/wonderlydotcom/freetool/tree/main/.agents/skills/entity-framework-fsharp
Command: npx skills add https://github.com/wonderlydotcom/freetool --skill entity-framework-fsharp

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the complexity of mapping F# data types like value objects, options, and discriminated unions across different layers of an application, specifically between JSON serialization (for APIs) and Entity Framework Core persistence (for databases).

Core Features & Use Cases

  • End-to-End Mapping: Provides guidance and patterns for mapping F# types from API JSON requests/responses through DTOs and domain types to EF Core Value Converters and SQLite storage.
  • Layered Responsibilities: Clearly defines where mapping logic should reside within the Onion Architecture (Domain, Application, API, Infrastructure).
  • Use Case: When adding a new F# discriminated union type to represent different user input types, this Skill helps you implement the necessary JSON converters for the API and ValueConverter for the database, ensuring consistent data handling.

Quick Start

Use the entity-framework-fsharp skill to map F# value objects and discriminated unions across JSON and Entity Framework Core boundaries.

Frequently Asked Questions about entity-framework-fsharp

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

FAQPage Schema
How do I map F# discriminated unions to Entity Framework Core?

Yes, EF Core Value Converters allow you to map F# value objects and options to SQLite-backed repositories by defining explicit conversion logic between your domain types and the database column representation.

How do I serialize F# value objects and options for JSON APIs?

You serialize F# value objects and options for JSON APIs by implementing custom API JsonConverters that translate your domain types into JSON-compatible representations for API requests and responses.

Where should mapping logic reside in an onion architecture for F#?

In an onion architecture, mapping logic should reside in specific layers: DTOs and API JsonConverters in the API layer, domain types in the Domain layer, and EF Core Value Converters in the Infrastructure layer.

Can I use EF Core Value Converters with F# records for SQLite storage?

Yes, you can use EF Core Value Converters with F# records for SQLite storage by defining how the record's fields convert to and from database column values, ensuring proper persistence of your domain types.

What is the best way to handle F# type mapping across API and database boundaries?

The best way to handle F# type mapping across boundaries is to use API JsonConverters for JSON serialization and EF Core Value Converters for database persistence, keeping mapping logic clearly separated within your architectural layers.