YairHalberstadt / stronginject

compile time dependency injection for .NET
MIT License
845 stars 24 forks source link

StrongInject Source Generator API #189

Open ettud opened 2 years ago

ettud commented 2 years ago

What do you think about exposing SourceGenerator and IncrementalGenerator though the separate package? E. g. if I wanted to write another source generator that writes [Register(typeof(SomeController), Scope.InstancePerResolution)] and IContainer<SomeController> for each controller in the project, it wouldn't work since source generators run separately. However, if there were some API, I could call StrongInject source generator from my source generator the same way you do it in the tests in the TestBase.cs.

YairHalberstadt commented 2 years ago

Hi @ettud what exactly would you like this API to look like? Do you just want the generators to be public?

My recommendation is to fork StrongInject and to get something that works. Then if it seems broadly useful I'd be happy to take the changes upstream.