I have the below Controller class
public class HomeController : Controller { public ActionResult Index(CustomerModel model) { Validate.ValidateModel(model); HttpContext.Application["IsAppIdAvailable"]; return View(); } } and I have a Validate.cs class file like below
public class Validate { public static void Test() { if(Convert.ToBoolean(HttpContext.Application["IsAppIdAvailable"])) { //Just assume this senario return true; } } } In the test method of the Validate class we are not able to access the HttpContext.Application but we are able to access the HttpContext.Application in the HomeController.
I understand the HomeController inherit from Controller class because of that HttpContext.Application has value.
Is there anyway I can access the HttpContext.Application in a class which does not inherit Contoller class. Please help