Reputation: 374
We have already REST API with three different method to 1.create record, 2. validate record and 3.confirm record.
When we create record it will be created with basic details without validation and shown in Web page.
Once user is ready to confirm then he can select that and click on confirm. From javascript now we are calling first Validate method based on response we proceed to call confirm method in REST API.
We are using unit of work pattern and custom filter action attribute class to execute methods of committing changes to DB.
Now we got requirement where I have to write a wrapper rest API which will handle all this in one REST Method.
Here the thing is Create record should be successful even the second step fails or third step fails.
As I have used unitofwork actionattribute for newly created wrapper it is not creating anything if it fails how to handle this?
Shall I call that separate REST API methods from my wrapper RESTAPI? or Is there a way to commit changes after first step then proceed the other steps.
We are using Nhibernate and UnitOfWork Actionfilterattribute custom logic in C#.
Thanks, Nagasree.
Upvotes: 1
Views: 51