Home WCF Async only operation
Reply: 1

WCF Async only operation

Jebik Published in 2017-10-20 08:44:06Z

I have a client that use both async and sync method from a WCF service.

I don't see any good reason to keep some sync call. Since I can with Task call async method within a sync one.

And it's better to not block UI when I call my service.

So I'm currently trying to remove every sync call. First is it a good pratice in WCF? If not why?

And second I use svcutils to generate my files. I have both sync and async call.

The project is big and to remove sync call the easiest way is to generate only async call with svcutils. So with compile error I will be able to only keep async easily.

But I can't find any option on svcutils that disable the sync method generation.

Any way to do so?

mustf4 Reply to 2017-10-20 09:27:10Z

In case if it is UI application it is better to use only async methods, as you said - to not block UI during calls.

Regarding svcutil.exe, it can't create only async methods and ignore sync's. You can use /async parameter, but it will create all as async, which does not work for you. Means, better to delete synchronous methods manually first.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.294371 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO