Skip to content

Commit 9929337

Browse files
committed
Fix comments
1 parent c1fa301 commit 9929337

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

docs/recipes/patterns/add-dependency-injection.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,19 @@
1414
1515
> Instead of functions or modules, DI in .NET and F# only works with classes.
1616
17-
2. Register your type with ASP .NET, typically in the start up / bootstrapper.
17+
2. Register your type with ASP .NET during startup within the `application { }` block.
1818
```diff
1919
++ open Microsoft.Extensions.DependencyInjection
2020
2121
application {
22+
//...
2223
++ service_config (fun services -> services.AddSingleton<DatabaseRepository>())
23-
}
2424
```
2525
2626
> [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.
2727
2828
3. Ensure that your Fable Remoting API can access the `HttpContext` type by using the `fromContext` builder function.
2929
```diff
30-
let webApp =
31-
Remoting.createApi ()
3230
-- |> Remoting.fromValue createFableRemotingApi
3331
++ |> Remoting.fromContext createFableRemotingApi
3432
```

0 commit comments

Comments
 (0)