Skip to content

Tutorial 02 13 Supporting CRUD Operations

mattl91 edited this page Jan 26, 2023 · 5 revisions

Harmony Core Logo

Supporting CRUD Operations

Everything that has been discussed so far has been related to endpoints that allow data to be queried in a variety of ways via HTTP GET requests. But many web services also allow data to be created, updated, and deleted. The tutorial will continue by extending the sample OData service to support those types of operations.

VIDEO: Creating a Basic Solution

Once again, this will be achieved by setting various options in the Harmony Core GUI tool. And these options will result in the generation of additional endpoint methods into the web service controller classes.

In RESTful web services, the type of CRUD operation to be completed is determined by the HTTP verb that is used to access a particular endpoint. As you already know, if you want to read a particular entity (perhaps a customer), you do so by using an HTTP GET request to the customer endpoint. Creating, updating, patching, and deleting an entity is similar, except that a different HTTP verb is used to indicate the type of operation to be performed. These HTTP verbs and the operations they are associated with are as follows:

HTTP Verb Type of Operation
POST Creates a new entity, with the primary key of the new entity being selected by custom code in the service.
PUT "Upserts" an entity. If the entity exists it is replaced; otherwise, a new entity is created.
PATCH Applies specific changes to an existing entity, altering specific properties only.
DELETE Deletes an entity.

Next topic: Adding a Primary Key Factory


Clone this wiki locally