Fluent.Unions.Dapper 1.1.0

dotnet add package Fluent.Unions.Dapper --version 1.1.0
                    
NuGet\Install-Package Fluent.Unions.Dapper -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Fluent.Unions.Dapper" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Fluent.Unions.Dapper" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Fluent.Unions.Dapper" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Fluent.Unions.Dapper --version 1.1.0
                    
#r "nuget: Fluent.Unions.Dapper, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Fluent.Unions.Dapper@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Fluent.Unions.Dapper&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Fluent.Unions.Dapper&version=1.1.0
                    
Install as a Cake Tool

Fluent.Unions

Fluent.Unions.Dapper

NuGet Downloads Publish Documentation

Maps Option<T> to and from database NULL with Dapper type handlers: no value is NULL, a value is the value. It builds on Fluent.Unions and Dapper (Apache-2.0).

Installation

dotnet add package Fluent.Unions.Dapper

Usage

Register a handler once at startup for every T you use in an Option<T>, or register the common database types at once.

using Fluent.Unions.Dapper;

FluentUnionsDapper.Register<int>();
FluentUnionsDapper.Register<OrderStatus>();
FluentUnionsDapper.Register(); // bool, byte, short, int, long, float, double, decimal, string, Guid, DateTime, DateTimeOffset, TimeSpan, byte[]

Use an option as a parameter and as a column.

connection.Execute("UPDATE person SET age = @age WHERE id = @id", new { id, age = Option.Some(30) });
// age = Option.None writes NULL

public class PersonRow
{
    public int Id { get; set; }
    public Option<string> Nickname { get; set; }
    public Option<int> Age { get; set; }
}

IEnumerable<PersonRow> people = connection.Query<PersonRow>("SELECT id, nickname, age FROM person");

Dapper cannot fill the constructor of a positional record from an Option<T> column. Use properties with set or init.

Dapper.AOT is not supported. It generates its own mapping code and does not call these handlers.

Documentation

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 94 11/22/2026
1.0.0 95 11/21/2026
0.3.0 101 11/20/2026