Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exception handling for servicemodel exceptions
- try{ call to service }
- catch(CommunicationObjectFaultedException){}
- catch (EndpointNotFoundException){}
- public static bool TryExecute(Action a) {
- try {
- a();
- return true;
- }
- catch (CommunicationObjectFaultedException) { }
- catch (EndpointNotFoundException) { }
- return false;
- }
- bool ok = TryExecute(() => {
- // call to service
- //...
- });
Add Comment
Please, Sign In to add comment