I get this error on this method:
[HttpGet]
public HttpResponseMessage Search([ModelBinder(typeof(ApiDataTablesModelBinder))] IDataTablesRequest requestModel)
{
var sortedColumn = requestModel.Columns.GetSortedColumns().SingleOrDefault();
bool isDesc = false;
string sortField = "ID";
var projects = lkp_surveyRepo.GetAll();
var filteredResults = projects;
filteredResults = projects.Where(x => x.code == selectedDistrictID);
var pagedResults = filteredResults.Skip(requestModel.Start).Take(requestModel.Length);
var result = Request.CreateResponse(HttpStatusCode.OK, new DataTablesResponse(requestModel.Draw, pagedResults, filteredResults.Count(), projects.Count()));
return result;
}
my controller implements a controller:
public class HomeController : Controller
{
I found this question, but the answer did not help me:
CreateResponse method in asp.net web interface
full error:
Error 13 'System.Web.HttpRequestBase' does not contain a definition for "CreateResponse" and the best overload of the extension method "System.Net.Http.HttpRequestMessageExtensions.CreateResponse (System.Net.Http.HttpRequestMessage, System.Net.HttpStatusCode, T) some invalid arguments
Do you see what I'm doing wrong? maybe something is wrong with what's inside the method CreateResponse... thanks
source
share