The ServiceActionResult Pattern. Part Two

Continuing from my previous post The ServiceActionResult Pattern
This could also be implemented in a Generic Repository Pattern. If you have read, any post about a using a generic repository, it usually looks something like this:

The interesting part is the Update/Delete/Insert methods.
Yes… you could return a boolean saying whether or not the transaction was successful.
But we could also use the ServiceActionResult “Pattern”, to make it look something like this;

Which gives us that nice granular return state AND the actual entity in question (which is nice for RESTful services)

Leave a Reply

Your email address will not be published. Required fields are marked *