Like the title says:
My web service method call looks like
proxy.BeginGetWhatever(int param)
{
}
Lets assume the handler registered with this call is
private void GetWhateverCompleted(object sender, GetWhateverEventArgs e)
{
//HERE
}
How do I get access to the parameter param in the handler? (e.Result will return whatever the web service call is supposed to fetch. I am interested in making param available as well)
Each async method generated for a WCF proxy will have an overload that takes a
userStateparameter. For example, if you have aGetCustomerByIDmethod, you’ll see two overloads:You can put whatever you want in
userStateand it will be sent back in the completion event. So if you just want the originalcustomerIDback, in the above case:You can put anything you want in
userState, so if the method takes several parameters, you can put them all into a custom class and pass the class as the state.