Kenny Tordeur

Random thoughts about Asp.Net MVC

  • Home
Kenny Tordeur-Banner

Month: May 2015

May11 0

Injecting a service in a view

Posted by Kenny Tordeur

In the ASP.NET MVC 6, you can now use the @inject keyword. This allows you to inject a service (class) into your view. This class must be public, non-nested and non-abstract. The @inject needs 2 “parameters” in order to work. @inject [name of your class] [variable name that can be used in your view] My […]

Read More →
ASP.NET MVC dependency injection

Recent Posts

  • Session state in Asp.net Core
  • Localization of an Asp.net mvc Core application
  • Cache and cache profiles
  • Cache tag helper in MVC 6
  • How to organize your Asp.net mvc controller

Archives

  • August 2016
  • June 2016
  • May 2016
  • December 2015
  • November 2015
  • October 2015
  • May 2015
  • April 2015
  • March 2015
  • July 2014
  • January 2014
  • January 2013
  • December 2012
  • August 2012

Categories

  • ASP.NET (1)
  • ASP.NET MVC (14)
  • C# (1)
  • Javascript (1)

Archives

  • August 2016
  • June 2016
  • May 2016
  • December 2015
  • November 2015
  • October 2015
  • May 2015
  • April 2015
  • March 2015
  • July 2014
  • January 2014
  • January 2013
  • December 2012
  • August 2012

Meta

  • Log in
© 2014 ascent. All rights reserved | Ascent by NetTantra