Danom 2.1.0
dotnet add package Danom --version 2.1.0
NuGet\Install-Package Danom -Version 2.1.0
<PackageReference Include="Danom" Version="2.1.0" />
<PackageVersion Include="Danom" Version="2.1.0" />
<PackageReference Include="Danom" />
paket add Danom --version 2.1.0
#r "nuget: Danom, 2.1.0"
#:package Danom@2.1.0
#addin nuget:?package=Danom&version=2.1.0
#tool nuget:?package=Danom&version=2.1.0
Danom
Danom provides Option and Result types for C#, inspired by F#. It’s designed to be easy to use, efficient, and compatible with existing C# codebases. These types offer a type-safe way to represent nullable values and expected errors, while also supporting a fluent API (e.g., map, bind) for chaining operations and value transformations.
Key Features
- Implementation of common monads: Option and Result.
- Exhaustive matching to prevent null reference exceptions.
- Fluent API for chaining operations, including async support.
- Built-in error handling with ResultErrors.
- An API for parsing strings into .NET primitives and value types.
- Input validation via Danom.Validation.
- Integration with ASP.NET MVC and ASP.NET Minimal API.
Design Goals
- Provide a safe and expressive way to handle nullable values.
- Efficient implementation to minimize overhead.
- Enforce exhaustive matching.
- Enhance functional programming in C#.
- Opionated monads to encourage consistent use.
- Support for both synchronous and asynchronous operations.
netstandard2.1compatible.
Getting Started
Install the Danom NuGet package:
dotnet add package Danom
OR
PM> Install-Package Danom
Input Validation
One of the places the Result type really shines is input validation. It's a natural step in most workflows to validate input data before processing it, and the Result type is a great way to handle this. The Danom.Validation library provides an API for defining validation rules and checking input data against those rules, returning a Result<T, ResultErrors> that contains either the validated data or an error message.
Integrations
Since Danom introduces types that are most commonly found in your model and business logic layers, external integrations are not only inevitable but required to provide a seamless experience when building applications.
These are completely optional, but provide a great way to integrate Danom with your codebase.
ASP.NET Core MVC & Razor Pages Integration
Danom is integrated with ASP.NET Core MVC (and Razor Pages) via Danom.Mvc. This library provides a set of utilities to help integrate the core types with common tasks in ASP.NET Core MVC applications.
ASP.NET Core Minimal API Integration
Danom is integrated with ASP.NET Core Minimal API via Danom.MinimalApi. This library provides a set of utilities to help integrate the core types with common tasks in ASP.NET Core Minimal API applications.
Find a bug?
There's an issue for that.
License
Licensed under MIT.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.1 is compatible. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- No dependencies.
-
net6.0
- No dependencies.
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Danom:
| Package | Downloads |
|---|---|
|
Danom.Validation
Validators and validation helpers for Danom. |
|
|
Danom.Mvc
ASP.NET Core MVC and Razor Pages support for Danom. |
|
|
Danom.MinimalApi
ASP.NET Core Minimal API support for Danom. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0 | 184 | 12/30/2025 |
| 2.0.0 | 412 | 9/17/2025 |
| 2.0.0-beta6 | 271 | 8/8/2025 |
| 2.0.0-beta5 | 189 | 7/17/2025 |
| 2.0.0-beta4 | 239 | 6/24/2025 |
| 2.0.0-beta3 | 185 | 6/23/2025 |
| 2.0.0-beta2 | 336 | 5/16/2025 |
| 2.0.0-beta1 | 236 | 4/18/2025 |
| 1.2.0 | 721 | 12/6/2024 |
| 1.1.1 | 176 | 12/6/2024 |
| 1.1.0 | 162 | 12/1/2024 |
| 1.0.0 | 220 | 11/18/2024 |
| 1.0.0-beta1 | 195 | 10/11/2024 |
| 1.0.0-alpha3 | 157 | 8/31/2024 |
| 1.0.0-alpha2 | 212 | 8/30/2024 |
| 1.0.0-alpha1 | 144 | 8/28/2024 |