HODI 2.2.0
dotnet add package HODI --version 2.2.0
NuGet\Install-Package HODI -Version 2.2.0
<PackageReference Include="HODI" Version="2.2.0" />
<PackageVersion Include="HODI" Version="2.2.0" />
<PackageReference Include="HODI" />
paket add HODI --version 2.2.0
#r "nuget: HODI, 2.2.0"
#:package HODI@2.2.0
#addin nuget:?package=HODI&version=2.2.0
#tool nuget:?package=HODI&version=2.2.0

HODI
Higher Order Dependency Injection
HODI is a set of functions designed to be simple and consistent with a minimal implementation.
The purpose of this library is to make unit testing of functions used as HTTP handlers in F# web applications more straightforward.
Install
PM> Install-Package HODI
or...
dotnet add package HODI
Defining Handlers
Instead of...
let oldWayHandler : HttpHandler =
fun (next: HttpFunc) (ctx: HttpContext) ->
task {
let dep = ctx.GetService<Dependency>()
// ...
}
this can be done...
let anotherWayHandler : HttpHandler =
fun (dep: Dependency) (next: HttpFunc) (ctx: HttpContext) ->
task {
// ...
}
Usage
The functions can be used when defining routes.
let app =
choose [
route "/a" >=> exampleHandler |> inject
route "/b" >=> handlerWith2Dependencies |> inject2
routef "/c/%s" >=> handlerWithArgumentAndDependency |> injectPlus
]
Unit Testing
When unit testing the HTTPHandler functions, you could simply pass the dependencies without having to set up a test server. In other words, the tests can focus on the handlers behavior instead of caring about dependency injection.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. 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. |
| .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
- FSharp.Core (>= 6.0.0)
- Microsoft.AspNetCore.Http (>= 2.2.0)
- Microsoft.Extensions.DependencyInjection (>= 7.0.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 |
|---|---|---|
| 2.2.0 | 305 | 5/13/2025 |
| 2.1.1 | 242 | 8/15/2023 |
| 2.0.6 | 389 | 1/21/2023 |
| 2.0.5 | 386 | 1/21/2023 |
| 2.0.3 | 419 | 1/21/2023 |
| 2.0.1 | 517 | 10/26/2022 |
| 2.0.0 | 616 | 4/3/2022 |
| 1.2.5 | 566 | 4/3/2022 |
| 1.2.4 | 582 | 4/2/2022 |
| 1.2.3 | 566 | 4/2/2022 |
| 1.2.2 | 460 | 9/28/2021 |
| 1.2.0 | 509 | 4/26/2021 |
| 1.1.1 | 525 | 4/24/2021 |
| 1.1.0 | 488 | 4/22/2021 |
| 1.0.3 | 490 | 4/22/2021 |
| 1.0.2 | 537 | 4/18/2021 |
| 1.0.1 | 494 | 4/16/2021 |
| 1.0.0 | 516 | 4/16/2021 |