In a data structure, should we create a CRUD for each entity?
Hi,
At least you need a Create and Update, normally we create CreateUpdate in the same action.
Regards
Thanks Paulo Torres..
Hello
Yes in Outsystems when ever we create a transaction Entity then 6 entity actions are already created.
Now to use these action we will wrap them into a server action and use it as wrapper action.It depends on your requirement what wrapper action you want specific to your entity,
ThanksTousif Khan
Thanks Tousif Khan..
You only need the CRUD if the entity is exposed public AND exposed read-only AND you update, create or delete is outside of that module (in another module).
My advise is to avoid the CreateOrUpdate and make a separate Create and Update. In your code it should be clear if you intend to update an existing record or create a new record and not "gamble" what will happen ;-)
Note that a best practice wrapper for a save action looks like this:
So have a seperate path for Update and Create. Avoid the CreaterOrUpdate if at all possible, as it is slower, especially for Creates.