Feature request: Control the visibility of DiscoveredServicesExtensions
#45
Labels
enhancement
New feature or request
DiscoveredServicesExtensions
#45
Hi!
Thanks for putting this project together. It's saved me a fair bit of boilerplate. 🙂
I was wondering if it would be possible to add an MSBuild property to control the visibility of the generated
DiscoveredServicesExtensions
class? Specifically, here:Injectio/src/Injectio.Generators/ServiceRegistrationWriter.cs
Lines 50 to 54 in 89941f3
In my solution, I have a few different projects for different areas of the application. Each such project already exposes a
<Project>ServiceCollectionExtensions
class with methods to register everything. This class needs to stay because, even when using Injectio, there are various essential services defined outside the assembly that also need to be added (e.g. ASP.NET Core stuff,AddOptions<T>()
, etc...). So I figure I'll just call Injectio's generated method from there. That means exposingDiscoveredServicesExtensions
publicly isn't necessary (and kind of a trap since it lacks those essential service registrations).I figure this feature could just look something like
<InjectioVisibility>internal</InjectioVisibility>
(defaulting topublic
).The text was updated successfully, but these errors were encountered: