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 596 B

123456789101112131415161718192021222324252627
  1. ---
  2. uid: Discord.Commands.DontInjectAttribute
  3. remarks: *content
  4. ---
  5. The attribute can be applied to a public settable property inside a
  6. @Discord.Commands.ModuleBase based class. By applying this attribute,
  7. the marked property will not be automatically injected of the
  8. dependency. See @Guides.Commands.DI to learn more.
  9. ---
  10. uid: Discord.Commands.DontInjectAttribute
  11. example: [*content]
  12. ---
  13. ```cs
  14. public class MyModule : ModuleBase<SocketCommandContext>
  15. {
  16. [DontInject]
  17. public MyService MyService { get; set; }
  18. public MyModule()
  19. {
  20. MyService = new MyService();
  21. }
  22. }
  23. ```