I have a webforms project.
I use nuget to install web API by running Install-Package WebApi.All
I create a class
public class CartController : System.Web.Http.ApiController
but it cannot resolve symbol Http in System.Web.Http, what dependency am I missing?
The IHttpActionResult interface is contained in the System. Web. Http namespace and creates an instance of HttpResponseMessage asynchronously.
Web API Controller is similar to ASP.NET MVC controller. It handles incoming HTTP requests and send response back to the caller. Web API controller is a class which can be created under the Controllers folder or any other folder under your project's root folder.
The name of the package for the ASP.NET Web API isn't "WebApi.All". The package for the ASP.NET Web API (Beta) is "AspNetWebApi". Try running the following instead:
Install-Package AspNetWebApi
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With