Skip to content

Commit

Permalink
Use IApplicationCommandResultHandler as an example
Browse files Browse the repository at this point in the history
  • Loading branch information
KubaZ2 committed Sep 12, 2024
1 parent 2769565 commit e8bb69c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Documentation/guides/services/dependency-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Dependency injection (DI) is a technique that helps make your code more modular

## Scopes

With `NetCord.Hosting.Services` scopes are created for each command/interaction and disposed after the command/interaction is **completely** executed by default. Therefore all code relevant to the command/interaction like for example the @NetCord.Hosting.Services.ApplicationCommands.ApplicationCommandResultHandler`1 will be executed within the same scope.
With `NetCord.Hosting.Services` scopes are created for each command/interaction and disposed after the command/interaction is **completely** executed by default. Therefore all code relevant to the command/interaction like for example the @NetCord.Hosting.Services.ApplicationCommands.IApplicationCommandResultHandler`1 will be executed within the same scope.

You can control whether to use scopes or not by setting the `UseScopes` property in the options class. For example @NetCord.Hosting.Services.ApplicationCommands.ApplicationCommandServiceOptions`2.UseScopes for application commands.

Expand Down

0 comments on commit e8bb69c

Please sign in to comment.