NetCordDev / NetCord

The modern and fully customizable C# Discord library.
https://netcord.dev
MIT License
65 stars 10 forks source link

[Proposal] Allow `IServiceProvider` to be accessible in contexts by default. #7

Closed csmir closed 1 year ago

csmir commented 1 year ago

Being a huge part of .NET as a whole, services should be accessible during module execution by default, one way or another. This proposal offers to implement an IServiceProvider property to the default IContext, which is implemented throughout the entire context design. All front facing context creators implement it as an optional, nullable parameter which can be completely ignored.

KubaZ2 commented 1 year ago

I think the plan is to implement normal DI for NetCord.Services. Also allowing IServiceProvider to be nullable is not really user friendly, you have to put ! to use the provider properly.

KubaZ2 commented 1 year ago

Since a proper DI has been implemented, I don't think this feature is needed anymore.