-
Notifications
You must be signed in to change notification settings - Fork 14
Tutorial 02 13 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.
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
-
Tutorial 2: Building a Service from Scratch
- Creating a Basic Solution
- Enabling OData Support
- Configuring Self Hosting
- Entity Collection Endpoints
- API Documentation
- Single Entity Endpoints
- OData Query Support
- Alternate Key Endpoints
- Expanding Relations
- Postman Tests
- Supporting CRUD Operations
- Adding a Primary Key Factory
- Adding Create Endpoints
- Adding Upsert Endpoints
- Adding Patch Endpoints
- Adding Delete Endpoints
-
Harmony Core Code Generator
-
OData Aware Tools
-
Advanced Topics
- CLI Tool Customization
- Adapters
- API Versioning
- Authentication
- Authorization
- Collection Counts
- Customization File
- Custom Field Types
- Custom File Specs
- Custom Properties
- Customizing Generated Code
- Deploying to Linux
- Dynamic Call Protocol
- Environment Variables
- Field Security
- File I/O
- Improving AppSettings Processing
- Logging
- Optimistic Concurrency
- Multi-Tenancy
- Publishing in IIS
- Repeatable Unit Tests
- Stored Procedure Routing
- Suppressing OData Metadata
- Traditional Bridge
- Unit Testing
- EF Core Optimization
- Updating a Harmony Core Solution
- Updating to 3.1.90
- Creating a new Release
-
Background Information