I have a WPF application in PRISM architecture.
From what I read on the net, I saw that it is best if View-Models invokes the WCF service using ASYNC , and also it is best to create a new connection for each operation . (I was told that itβs not good to keep in touch alive for too long).
My question is: how do I embed WCF clients in my view model?
If I just create an interface for the "automatically generated" client - and implement the interface - it will just create an instance for the client in my View-Model constructor, but it will not help me if I want to create a new client for every operation that I perform in the window .
For this, I need something like a "client factory" for input.
Can anyone give their opinion on this?
source share