Oneiro.AspNetCore.LanguageExt 1.0.0

dotnet add package Oneiro.AspNetCore.LanguageExt --version 1.0.0
                    
NuGet\Install-Package Oneiro.AspNetCore.LanguageExt -Version 1.0.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="Oneiro.AspNetCore.LanguageExt" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oneiro.AspNetCore.LanguageExt" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Oneiro.AspNetCore.LanguageExt" />
                    
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 Oneiro.AspNetCore.LanguageExt --version 1.0.0
                    
#r "nuget: Oneiro.AspNetCore.LanguageExt, 1.0.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 Oneiro.AspNetCore.LanguageExt@1.0.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=Oneiro.AspNetCore.LanguageExt&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Oneiro.AspNetCore.LanguageExt&version=1.0.0
                    
Install as a Cake Tool

Oneiro AspNetCore LanguageExt

FSharp Validations CI NuGet Version

Converts LanguageExt monads to AspNetCore's IResult for minimal APIs or IActionResult for controller based APIs.

Installation

dotnet add package Oneiro.AspNetCore.LanguageExt

Quick Reference

  • Any monad that has a proper object will return a success code of 200 OK with a response body
  • Any monad that returns Unit will return a success code of 204 No Content
  • The Option<T> monad will either be a success of 200 or 204 and the none condition is converted to a 404 Not Found
    • Monad with nested Option<T> such as Fin<Option<T>> could return 200, 204, 404, or 500 as Fin<Option<T>> could be a success with an option of
      • Unit (204)
      • T (200)
      • None (404)
      • Error (500).
  • The Try monad will return either a 200, 204, or 500
  • The TryOption monad will return either a 200, 204, 404, or 500
  • The Eff monad will return a 200, 204, or 500
  • The Aff monad will return a 200, 204, or 500

Proper IEFT problem detail responses will be presented with the appropriate status code based on the exception that is contained within the Fin, Try, TryOption, Eff, and Aff monads.

Usage

LanguageExt monads can be converted to Action or IResult. The extensions functions can be used by importing Oneiro.

Quick Start

using Oneiro;
//. Other code

IResult result = Try(() => "Hello, World!").ToResult();

Minimal APIs

using static LanguageExt.Prelude;
using Oneiro;

interface IService { Option<string> GetMessage(); }

class MyService : IService {
    Option<string> GetMessage() => "Hello, World!";
}

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddTransient<IService, MyService>();

var app = builder.Build();

app.MapGet("/", (IService service) => service.GetMessage().ToResult());

app.Run();
Product Compatible and additional computed target framework versions.
.NET 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 was computed.  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. 
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.0.0 144 2/6/2025