In application development, Create, Read, Update, and Delete (CRUD) are the four basic functions of persistent storage, such as databases. CRUD refers to the commonly used functions in the relational database. The following table shows you how CRUD maps to the standard SQL and HTTP:
Operation |
SQL |
HTTP |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
In the following example, we will use $http
of the AngularJS framework to consume the ASP.NET Web API. In order to call the ASP.NET Web API, we first create a controller in a web API named CustomerController
, which has the following action methods:
public class CustomerController : ApiController { NorthwindEntities _db = new NorthwindEntities(); [HttpGet] public IHttpActionResult Customer() { _db.Configuration.ProxyCreationEnabled = false; var customer = _db.Customers; ...