siscodeorg / sisbase

An easy to use discord bot base for D#+. Discord Link :
https://discord.gg/ycvm6xJ
MIT License
1 stars 0 forks source link

Use dsp-cnext service provider to Inject the SMC's systems cleanly onto commands using MS.DI. #7

Closed alikindsys closed 4 years ago

alikindsys commented 4 years ago

dsp-cnext has a exposed service provider that could be used to use systems inside commands, if that's deemed valid/necessary.

Usage after implemented would be like this


class command:cbm {
    prop SystemType System {get;set;}
    pat command(cc ctx){
       //Use whatever is needed from System.
    }
}
alikindsys commented 4 years ago

superseded by #47 as SisbaseCommandModule.SystemManager.GetOrDefault<T>();