I'm using .net core 2.1 , when I created controller and inherit ApiController. but in my controller method return type HttpResponseMessage and give a error given question title here is my method
[HttpGet]
[Route("GetAll")]
[AcceptVerbs("Get", "Post")]
public HttpResponseMessage SelectCAllCustomers()
{
try
{
return Request.CreateResponse<List<Customer>>(HttpStatusCode.OK, customerDetailsRepository.FindAll("SelectAllCustomers").ToList());
}
catch (Exception ex)
{
return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex);
}
}