Guest User

Guest User

  • Tech Writer
  • 98
  • 42.4k

HttpContext is null

Mar 3 2020 10:19 PM
I have the code below to set the HttpContext.Current. It works on Windows but in Mac I encounter the following errors:
 
'HttpContext' is a type, which is not valid in the given context
 
And a message when pointing the cursor to HttpContext
 
Inconsistent body style: use expression body
  1. public BrandModel Brand  
  2. {  
  3. get{  
  4. return (Get<BrandModel>("Brand"));  
  5. }  
  6. set{  
  7. HttpContext.Current.Session["Brand"] = value;  
  8. }  
  9. } 
What should I do?

Answers (3)