Adding support for ActivateAttribute via IControllerActivator

This mechanism replaces code in Inject that activated properties
by looking them up by names.


The difference here is the explicit decoration with activate

-----Original Message-----
From: "Pranav K" <notifications@github.com>
Sent: ‎6/‎13/‎2014 11:40 AM
To: "aspnet/Mvc" <Mvc@noreply.github.com>
Cc: "Yishai Galatzer" <yishai_galatzer@yahoo.com>
Subject: Re: [Mvc] Adding support for ActivateAttribute viaIControllerActivator (#648)

In src/Microsoft.AspNet.Mvc.Core/Controller.cs:
>          public ActionContext ActionContext { get; set; }
>  
> +        [Activate]
> +        public IServiceProvider ServiceProvider { get; set; }
> +
> +        [Activate]
> +        public IViewEngine ViewEngine { get; set; }
Somewhat analogous, but ModelBinding does not populate fields. We have a closer precedent of ignoring fields.
I don't have a strong opinion on non-public properties. Odds are if you are unit testing the controller, you are probably going to need these properties to be accessible anyway.
—
Reply to this email directly or view it on GitHub.