xxlo-devs / eru

Substitution information system that enables students from xxlo to get quick and personalized details about all substitutions directly from school.
https://xxlo-devs.github.io/eru/
MIT License
1 stars 0 forks source link

Allow automatic dependency injection #48

Open bsak2003 opened 4 years ago

bsak2003 commented 4 years ago

We need a way to simplify the Dependency Injection process, such as attribute [Inject] to automatically inject dependencies.

bsak2003 commented 4 years ago

Also, services loaded in this way should have deactivation switch ('enabled' property), like:

"Services": {
  "SampleService": {
    "enabled": true,
    "property": "value"
  }
}
bsak2003 commented 4 years ago

Old idea

This interface will allow DependencyInjection to automatically invoke all compatible DependencyInjectors.

public interface IDependencyInjector
{
    public void Add(IServiceCollection services, IConfiguration configuration);
    public void Use(IApplicationBuilder app, IConfiguration configuration);
}