Answer the question
In order to leave comments, you need to log in
Space issue using System.Web.Http?
Started writing an Api-server, but ran into a problem. I create such a Product class, add properties to it. Then I create a controller, connect the namespace using System.Web.Http, write a method
public IHttpActionResult GetProduct(int id) // здесь ошибка Не удалось найти пространство имен IHttpActionResult
{
var product = products.FirstOrDefault((p) => p.Id == id);
if (product == null)
{
return NotFound();
}
return Ok(product);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question