Genesis.LanguageExt.AspNetCore
7.0.0
dotnet add package Genesis.LanguageExt.AspNetCore --version 7.0.0
NuGet\Install-Package Genesis.LanguageExt.AspNetCore -Version 7.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="Genesis.LanguageExt.AspNetCore" Version="7.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Genesis.LanguageExt.AspNetCore" Version="7.0.0" />
<PackageReference Include="Genesis.LanguageExt.AspNetCore" />
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 Genesis.LanguageExt.AspNetCore --version 7.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Genesis.LanguageExt.AspNetCore, 7.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 Genesis.LanguageExt.AspNetCore@7.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=Genesis.LanguageExt.AspNetCore&version=7.0.0
#tool nuget:?package=Genesis.LanguageExt.AspNetCore&version=7.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Genesis Minimal Endpoints: LanguageExt
Converts LanguageExt monads to ActionResult or minimal API IResult.
Quick Reference
- Any monad that has a proper object will return a success code of
200 OKwith a response body - Any monad that returns
Unitwill return a success code of204 No Content - The
Option<T>monad will either be a success of200or204and the none condition is converted to a404 Not Found- Monad with nested
Option<T>such asFin<Option<T>>could return200,204,404, or500asFin<Option<T>>could be a success with an option ofUnit(204)T(200)None(404)Error(500).
- Monad with nested
- The
Trymonad will return either a 200, 204, or 500 - The
TryOptionmonad will return either a 200, 204, 404, or 500 - The
Effmonad will return a 200, 204, or 500 - The
Affmonad 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 Genesis.
Quick Start
using Genesis;
//. Other code
IResult result = Try(() => "Hello, World!").ToResult();
Minimal APIs
using static LanguageExt.Prelude;
using Genesis;
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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. 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.
-
net7.0
- Genesis.MinimalApis (>= 7.1.0)
- LanguageExt.Core (>= 4.4.0)
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 |
|---|---|---|
| 7.0.0 | 486 | 5/30/2023 |