Hi ,
I am using working in C# - CSOM in SharePoint platform.
I have scenario where the code is executed asynchronously as shown in the following code below.
My requirement is that each method has be executed synchronously, like Method1 has to executed first,completed, if there is no Exception in Method1, move to Method 2. Then Method2 has to be executed , if no exception , Method 3 has to be executed. In any case if there is any exceptions the code execution has to be stopped.
This has to be done with better performance, as I am using this code in an event handler where the code should not get timed out.
Please advise which would be my best way with some samples.
Thanks
private async void MainCall(ClientContext clientContext)
{
clientContext.Web.Method1(msg1);
//Method 2
clientContext.Web.Method2(msg2);
clientContext.Web.Method3(msg1);
}
No comments:
Post a Comment