ipjohnson / Grace

Grace is a feature rich dependency injection container library
MIT License
336 stars 33 forks source link

Method injection #233

Closed silkfire closed 4 years ago

silkfire commented 4 years ago

Does Grace support method injection? The reason I'm asking is because I'm thinking whether it'd be more optimal to load dependencies in my MVC controller on a per-action basis instead of by the use of constructor injection. Not all actions require a certain dependency, and it feels somewhat redundant to instantiate services that won't be used for a specific request.

ipjohnson commented 4 years ago

If you’re talking about mvc core [FromServices] that’s supported by the mvc framework across all containers.

silkfire commented 4 years ago

Cool, I had no idea ASP.NET Core supported that out of the box. I'll check it out!