Web API deletes file records in JSON format, apijson
Insus. NET series of Web Api learning articles, this is the last article in the plan, delete file records in JSON format. I learned how to update data in the previous article "PUT function demo in Web APIs" http://www.cnblogs.com/insus/p/437982.html. Data is involved in program development. To facilitate user management, the query, add, update, and delete functions are generally provided. This document deletes the data in the file.
The following is a detailed demonstration of Insus. NET. A type of Web Api: "DELETE ".
Add a public void Delee (Order order) method to API control, which indicates the core code section, that is, deleting the Item in List <Order>. The parameter uses model to facilitate a record to be a multi-primary key or an external key value. You are not sure about the number of parameters. Therefore, model is used for processing.
For other code, refer to the previous "PUT function demo in Web Api" at http://www.cnblogs.com/insus/p/437982.html.
Create an html webpage and write static code:
When loading data, the data row is dynamically generated. It obtains all the data of the file and displays it on the webpage:
Now we can write the Delete button event, because it is generated dynamically in the data line, I have to use the jQuery delegate implementation.
After completing the calculation, I have worked hard before and learned here, which has become simple and familiar. Finally, we will demonstrate the Code implemented above: