I am getting the following error while writing the below code -
Error
'System.Net.Http.HttpRequestMessage' does not contain a definition for 'GetRequestContext' and no extension method 'GetRequestContext' accepting a first argument of type 'System.Net.Http.HttpRequestMessage' could be found (are you missing a using directive or an assembly reference?)
Code
var context = actionContext.Request.GetRequestContext(); context.Principal = principal; I have referenced to the required library - System.Net.Http also but still the error is coming.
var context = Request.GetRequestContext();in System.Web.Http.