I have a generated code with partial method
{
...
partial void InterceptOperationCall(IOperationContext context);
...
async Task SomeMethod()
{
InterceptOperationCall(cntx);
await LongOperation(cntx);
}
}
and handwrited partial
{
partial void InterceptOperationCall(IOperationContext context)
{
}
}
I need to do async calls inside InterceptOperationCall
Does any one knows some way to workaround partial method restrictions?
Another words: I want to do InterceptOperationCall asynchronously and guaranteed before long operation, at the same time i want to optionaly declare body of this method in another file.
UPD as workaround solution i chose to:
- not use generated partial method stubs, and wrap with dynamic proxy (
Castle.DynamicProxy
) and intercept withAsyncInterceptorBase
from (Nito.AsyncEx
) - another option I see rewrite codegenerator
Any way I keep looking for better solution, and if someone know another ways to provide optional ability to wrap async calls with somoe async logic please help me.