Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacabraham committed Jan 12, 2024
1 parent c1fa301 commit 9929337
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions docs/recipes/patterns/add-dependency-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,19 @@
> Instead of functions or modules, DI in .NET and F# only works with classes.
2. Register your type with ASP .NET, typically in the start up / bootstrapper.
2. Register your type with ASP .NET during startup within the `application { }` block.
```diff
++ open Microsoft.Extensions.DependencyInjection
application {
//...
++ service_config (fun services -> services.AddSingleton<DatabaseRepository>())
}
```
> [This section](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-8.0#lifetime-and-registration-options) of the official ASP .NET Core article explain the distinction between different lifetime registrations, such as Singleton and Transient.
3. Ensure that your Fable Remoting API can access the `HttpContext` type by using the `fromContext` builder function.
```diff
let webApp =
Remoting.createApi ()
-- |> Remoting.fromValue createFableRemotingApi
++ |> Remoting.fromContext createFableRemotingApi
```
Expand Down

0 comments on commit 9929337

Please sign in to comment.