3
Answers

HttpContext is null

Guest User

Guest User

4y
18.5k
1
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)