pakrym / jab

C# Source Generator based dependency injection container implementation.
MIT License
1.03k stars 33 forks source link

Register both as service and implementation #133

Open notanaverageman opened 1 year ago

notanaverageman commented 1 year ago

When a service is registered as a base type, I want it to also be registered as self so that I can resolve it both via the base type and the self type.

This can be achieved with a RegisterAsSelf bool parameter in attributes. If you can direct me where to make the changes in generator code I can send a PR.

Eyliess commented 10 months ago

This would be a great quality of life improvement, I find myself running into this issue a lot.