Advertisement
Guest User

Untitled

a guest
May 1st, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. public static RETURN UseAndCloseService<SERVICE, RETURN>
  2. (Func<SERVICE, RETURN> block) where SERVICE : class,
  3. ICommunicationObject, new()
  4. {
  5. SERVICE service = null;
  6. try
  7. {
  8. service = new SERVICE();
  9. return block.Invoke(service);
  10. }
  11. finally
  12. {
  13. if (service != null)
  14. CloseWCFService(service);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement