You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

DontInjectAttribute.Overwrite.md 591 B

1234567891011121314151617181920212223242526
  1. ---
  2. uid: Discord.Commands.DontInjectAttribute
  3. ---
  4. ### Remarks
  5. The attribute can be applied to a public settable property inside a
  6. @Discord.Commands.ModuleBase based class. By applying this property,
  7. the marked property will not be automatically injected of the
  8. dependency. See [Dependency Injection](../../guides/commands/commands.md#dependency-injection)
  9. to learn more.
  10. ### Example
  11. ```cs
  12. public class MyModule : ModuleBase<SocketCommandContext>
  13. {
  14. [DontInject]
  15. public MyService MyService { get; set; }
  16. public MyModule()
  17. {
  18. MyService = new MyService();
  19. }
  20. }
  21. ```