good time to use method injection. The whole reason I am trying out
On Aug 21, 11:14 am, "Nate Kohari" <
nkoh...@gmail.com> wrote:
> Emad:
>
> To inject dependencies into controllers, you should use either constructor
> or property injection. For example, using property injection, your
> controller might look like this:
>
> public class AccountController : IController
> {
> [Inject] public IEmailService EmailService { get; set; }
>
> public ActionResult ResetPassword(string username, string password)
> {
> //...
> }
>
> }
>
> I'd suggest you use the most-current version of Ninject from the trunk
> (which will soon become 1.5). It has an extension called
> Ninject.Framework.Mvc that plugs into
ASP.NET MVC and causes your
> controllers to be activated via Ninject.
>
> -Nate
>