Exercise 2 – Creating server actions
In this second exercise, we will apply the knowledge gained in this chapter to create actions that will abstract CRUDs needed by our entities. In Chapter 5, Modeling Data by Using Entities, in the Exercise 1 – creating a data model section, we built a data model with our entities. Now, in exercise 2, we are going to learn and practice how to manipulate the data from this data model created earlier. With this, we are going to create the backend features that will support our frontend application in the future.
These actions are usually called wrappers, as they are an aggregation of manipulations that guarantee the compliance and integrity of our data and business rules.
So, starting with the exercise, let's follow these steps:
- Create a Server Action called
Ticket_CreateOrUpdate
:- Select the Logic tab, right-click on the Server Actions folder, and select Add Server Action. Name it
Ticket_CreateOrUpdate
:
- Select the Logic tab, right-click on the Server Actions folder, and select Add Server Action. Name it
...