I have to do an update operation on an API where I am passing a request body which need to be pushed to Db(call it D2).The projects layers looks like this
Controller -> Service -> Repository
So
1.some logic here in service.
2.Update the entity and return this response to the controller.
3.Now I am calling the Handler to do some operations
So all above steps are inside Update() method in command handler.
How do I make the Step 3 as async. Since I don't want to block the response which I have got from Step 2 and want to return it to the controller immedialtely.Meanwhile the Step 3 will continue its execution in background.