I am using System.Web.Http version 5.2.3.0 and .NET version 4.5.2
public HttpResponseMessage GET(string EnteredVariable) { Data DataModel = new Data(); using (DataTable aDataTable = DataRepository.GetDataByQualifier(EnteredVariable)) { foreach (DataRow ReturnedData in aDataTable.Rows) { DataInfo DataName = new Models.DataInfo(); ...Populate data items ... DataModel.DataList.Add(DataName); } } else { using (HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, DataModel)) { return response; } }
In the code above Request is null...I'm not sure how this can be since it is part of ApiController...this problem seems to have cropped up using .NET4.5.2 but I'm not positive because there really is no error besides Request being Null...