Roma1011/Injectify ? reverse-engineered prompt
Reverse engineered prompt
Build me a small C# library for .NET that makes dependency injection setup automatic.
I want to mark classes and interfaces with simple attributes for Singleton, Scoped, and Transient, then have one helper method scan one or more assemblies and register everything into IServiceCollection for me. If a class has an interface, it should bind the implementation to that interface automatically. It should also support generic interfaces and generic implementations where that makes sense.
Please include basic error handling too, especially if something gets more than one lifetime attribute, since that should throw a clear MultipleLifetimeException. Keep it lightweight, with no external dependencies, and make it easy to drop into an existing project.
Also add a few simple usage examples so I can see how to annotate services and call the registration helper from Program or Startup. If you need to check current .NET docs for any details, feel free to look them up online.
Are you gonna build this?
make sure you review the code using coderabbit