Skip to content
CAI
Software that uses CAICheck a score

efcore/EFCore.FSharp

52.0

Weak · 24 September 2026

7.2k

lines of production code

F#

primary language

5

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a .NET library that provides F\#-specific support for Entity Framework Core, enabling developers to use F\# types like Option and single-case unions in database models and queries. It includes scaffolding and migration generators that produce F\# source code from database schemas, along with value converters and SQL translation logic for F\#-specific constructs. The project also features a documentation generation tool and a comprehensive test suite to validate these integrations.

How it got here

2017–2020 — F\# integration and tooling

13 changes.

This period focused on establishing the project's foundational build infrastructure and significantly expanding support for F\# within Entity Framework Core. Key developments included implementing F\#-specific value converters, code scaffolding, and migration generation, alongside the creation of a documentation tooling system.

2021–2022 — F\# specific EF Core support

4 changes.

This period focused on deepening Entity Framework Core integration for F\# developers by adding support for F\#-specific types like Option and single-case unions in queries. The team also implemented F\#-specific components for build automation, design-time services, and migration model differencing to ensure full tooling and scaffolding compatibility.

Features

Add .devcontainer configuration for .NET development

The project now includes a complete development container setup for .NET Core. This adds a Dockerfile and supporting scripts to install specific .NET versions (including 5.0.100) and configure the VS Code environment with relevant extensions (C\#, F\#, Paket, FAKE) and analyzers, enabling consistent local and remote development.

.devcontainer · high confidence

Add support for F\# specific types in EF Core queries

Users can now use F\# Option types and single-case unions in Entity Framework Core queries. The library introduces new SQL translation logic for Option types (translating IsNone/IsSome to IS NULL/IS NOT NULL checks) and single-case unions, enabling these F\# constructs to be translated into valid SQL expressions.

src/EFCore.FSharp/Translations · medium confidence

Added F\# template files for documentation generation

Introduced a new set of F\# source files (helpers, master, modules, namespaces, nav, partMembers, partNested, and types) in the docsTool/templates directory. These files define the structure and rendering logic for generating documentation pages, including navigation menus, footers, and the display of types, modules, and namespaces.

docsTool/templates · high confidence

Added dark mode support and UI enhancements to the documentation site

The documentation site now supports a dark mode, allowing users to switch between light and dark themes via a toggle button that persists their preference. This change includes new JavaScript files for managing theme state and swapping CSS classes, alongside a new stylesheet defining the dark theme's visual properties. Additionally, the update introduces responsive table styling for code snippets, a hot-reload feature for development, and interactive tooltips for help text.

docsSrc/content · high confidence

F\# Migrations Model Differ Implementation

Added the F\#-specific implementation of the migrations model differ (FSharpMigrationsModelDiffer). This new component overrides the Diff and Add methods to correctly handle nullable types for column mappings, ensuring that migration operations accurately reflect the nullability of F\# properties.

src/EFCore.FSharp/Migrations/Internal · high confidence

Initial project structure and build infrastructure

The repository was initialized with a complete build and development infrastructure, including a FAKE-based build script, a solution file defining the project layout, and configuration files for .NET SDK and code formatting. This change also introduces a comprehensive Getting Started guide and updates the repository's .gitignore to reflect modern .NET and Paket workflows.

(repo-wide) · high confidence

Introduce F\# code scaffolding for EF Core models

Added new scaffolding generators (FSharpDbContextGenerator, FSharpEntityTypeGenerator, FSharpModelGenerator) that produce F\# source files (.fs) from an EF Core model. The generator creates a domain module containing entity types with F\#-style properties, nullable/option types, and data-annotation attributes (e.g., \[\<\>\] attributes for required, column, max-length, key, keyless, and table mappings). It also generates a DbContext file with OnConfiguring and sequence support, allowing users to scaffold F\#-friendly EF Core contexts and entities.

src/EFCore.FSharp/Scaffolding · high confidence

Introduce F\# migration and scaffolding infrastructure

Added new F\#-specific implementations for Entity Framework Core's migration system, including \FSharpMigrationOperationGenerator\, \FSharpMigrationsGenerator\, \FSharpMigrationsScaffolder\, and \FSharpSnapshotGenerator\. These components enable the generation of F\# source code for database migrations and model snapshots, allowing F\# developers to use the standard EF Core migration workflow with language-appropriate syntax.

src/EFCore.FSharp/Migrations/Design · high confidence

Introduce F\#-specific helpers and scaffolding services for EF Core

The library now provides a new set of helper functions for interacting with DbContext, including methods for finding, adding, updating, and removing entities in both synchronous and asynchronous contexts. Additionally, scaffolding services have been added to support generating F\# code from database schemas, with configurable options for how types and nullable columns are represented.

src/EFCore.FSharp · high confidence

Introduce FAKE-based build infrastructure

The project now uses a new FAKE (F\# Make) build script (build.fs) to automate the build, test, and release processes. This includes configuration for source and test file globbing, coverage thresholds, and integration with GitHub and NuGet. The build system also incorporates the Octokit library for GitHub API interactions and Argu for command-line argument parsing.

build · high confidence

Introduce docsTool for automated documentation generation

Added a new docsTool utility that automates the generation of API reference documentation and static site content from source files. The tool provides 'build' and 'watch' commands to process .fsx and .md files, render them using FSharp.Literate and Fable.React, and serve the resulting documentation via a local web server with live reload support.

docsTool · high confidence

Introduce new internal utility modules for EF Core integration

Added new internal utility modules to support Entity Framework Core integration: EntityFrameworkExtensions provides helper methods for accessing EF Core metadata and state; Multigraph implements a topological sort algorithm for dependency resolution; SharedTypeExtensions handles F\#-specific type mapping and serialization; StringBuffer provides a domain-specific language for generating indented C\# code. These utilities enable the library to generate and manage C\# code for EF Core scaffolding and migrations.

src/EFCore.FSharp/Utilities · high confidence

Support for F\# Option and Single-Case Union types in EF Core

The library now provides built-in value converters for F\# Option types and single-case discriminated unions. Users can enable this functionality by calling \UseFSharpTypes()\ on the \DbContextOptionsBuilder\, which automatically registers the necessary \ValueConverter\ implementations for these types across all entity properties.

src/EFCore.FSharp/Extensions · high confidence

Behavioural changes

Added internal helper utilities for F\# type mapping and literal generation

The F\# provider now includes new internal helper files (FSharpHelper.fs and FSharpUtilities.fs) that map .NET types to F\# keywords, handle escaping for strings and literals, and manage F\#-specific type names (such as seq, list, option). These utilities support the generation of valid F\# code by resolving type names and formatting literal values, which improves the correctness of the generated code and fixes compilation issues in scenarios like InsertData operations with 2D arrays.

src/EFCore.FSharp/Internal · high confidence

Enable design-time services for F\# projects

The F\# build targets now automatically register Entity Framework Core design-time services. This is achieved by adding a new F\# source file that references the EF Core design-time assembly and a corresponding MSBuild props file that includes this file for F\# projects, ensuring that tooling and scaffolding operations work correctly in F\# projects.

src/EFCore.FSharp/build · medium confidence

Test coverage

Add comprehensive test suite for EF Core F\# scaffolding and migrations

Added a new test project structure under \tests/\ to validate the F\# code generation and migration scaffolding features. This includes unit tests for \DbContext\ helpers, \FSharpUtilities\, and the \FSharpMigrationsScaffolder\. The suite covers scenarios such as generating model snapshots, handling composite keys, async operations, and overriding namespaces during migration scaffolding. Helper utilities like \BuildReference\ and \FakeDiagnosticsLogger\ were also added to support these tests.

tests · high confidence

Dependencies

Migrate build and project files to .NET 6 and Paket

The project's build infrastructure has been updated to target .NET 6.0, with the main library and test projects now using the net6.0 target framework. The build system has been migrated from FAKE to Paket, introducing new project files (build/build.fsproj, docsTool/docsTool.fsproj, src/EFCore.FSharp/EFCore.FSharp.fsproj, and tests/EFCore.FSharp.Tests/EFCore.FSharp.Tests.fsproj) and dependency manifests (paket.dependencies, paket.lock) to manage .NET 6 and related packages.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.

Score

  • CAI 49 → 52 (+3.1)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 66 → 63 (-2.1)
  • Architecture 100 → 88 (-11.6)
  • Maturity 41 → 41 (+0.0)
  • Readiness 36 → 52 (+15.9)
  • Security 90 → 74 (-16.4)

Resolved (13)

  • Dependency hygiene not measured — no packages were read
  • Duplicated block (10 lines × 3) (src/EFCore.FSharp/Utilities/SharedTypeExtensions.fs)
  • Duplicated block (12 lines × 2) (docsTool/templates/types.fs)
  • Duplicated block (15 lines × 2) (src/EFCore.FSharp/Migrations/Design/FSharpMigrationOperationGenerator.fs)
  • Duplicated block (5 lines × 2) (src/EFCore.FSharp/Migrations/Design/FSharpMigrationOperationGenerator.fs)
  • Duplicated block (60 lines × 2) (src/EFCore.FSharp/Internal/FSharpUtilities.fs)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Largest orphaned file (src/EFCore.FSharp/Migrations/Design/FSharpMigrationOperationGenerator.fs)
  • No exposed public API
  • Test reliability not included
  • complexity unreadable for .fs — churn × complexity hotspots could not be measured
  • dormant codebase — no living knowledge left to concentrate

New (28)

  • Documentation: no installation or build instructions (README.md)
  • Duplicated block (104 lines × 2) (src/EFCore.FSharp/Internal/FSharpHelper.fs)
  • Duplicated block (12 lines × 2) (docsTool/templates/modules.fs)
  • Duplicated block (12 lines × 2) (src/EFCore.FSharp/Migrations/Design/FSharpMigrationOperationGenerator.fs)
  • Duplicated block (13 lines × 3) (src/EFCore.FSharp/Internal/FSharpHelper.fs)
  • Duplicated block (16 lines × 2) (docsTool/templates/partNested.fs)
  • Duplicated block (32 lines × 2) (src/EFCore.FSharp/Migrations/Design/FSharpMigrationOperationGenerator.fs)
  • End-of-life runtime: .NET net5.0
  • End-of-life runtime: .NET net6.0
  • FileTooLong: Design/FSharpMigrationOperationGenerator.fs (src/EFCore.FSharp/Migrations/Design/FSharpMigrationOperationGenerator.fs)
  • FileTooLong: Design/FSharpSnapshotGenerator.fs (src/EFCore.FSharp/Migrations/Design/FSharpSnapshotGenerator.fs)
  • FileTooLong: Internal/FSharpHelper.fs (src/EFCore.FSharp/Internal/FSharpHelper.fs)
  • High secret: WD-SECRET-0003 (src/EFCore.FSharp/key.snk)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Low IaC: WD-DOCKER-0003 (.devcontainer/Dockerfile)
  • Low IaC: WD-DOCKER-0013 (.devcontainer/Dockerfile)
  • Medium: security finding (details withheld)
  • Medium: security finding (details withheld)
  • Medium: security finding (details withheld)
  • …and 8 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

efcore/EFCore.FSharp was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 24 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 920c43b2e1ae2a0d2a631ffafc4ee85166b308d3 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-923689c465cf.