-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Limit [FromServices] to apply only to parameters #3507
Comments
Agreed, we've had a number of issues posted by users with confusion around how this feature should be used. There's really been a fairly large amount of feedback both of the kinds " We feel like most valuable scenario for /cc @danroth27 - docs changes To anyone in love with the current |
@pranavkm Done? |
👍 |
This should help reduce a lot of the confusion around this feature.
It currently applies to parameters and properties. The problem with properties is that it appears to many people that it can be applied to any property of any object. But in reality it works only with properties on objects that are model bound, which is controller properties, and sub-properties of types used in MVC action method parameters.
By limiting
[FromServices]
to only parameters, that will restrict the usage to one that will always work: top-level action method parameters.cc @rynowak
The text was updated successfully, but these errors were encountered: