vendredi 13 avril 2018

using both database operation and external method in Unit of Work

I have to use a web service and update a table in database. Conventionally I perform these steps:

  1. Open a transcation
  2. Call db update method(There no risk If it is changed nothing because it will rollback)
  3. Call a web service(external)
  4. If web service results is 200(ok) then call commit else rollback

But unit of work has one method SaveChanges(). How can I do this scenario in unit of work?

Aucun commentaire:

Enregistrer un commentaire