Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static RETURN UseAndCloseService<SERVICE, RETURN>
- (Func<SERVICE, RETURN> block) where SERVICE : class,
- ICommunicationObject, new()
- {
- SERVICE service = null;
- try
- {
- service = new SERVICE();
- return block.Invoke(service);
- }
- finally
- {
- if (service != null)
- CloseWCFService(service);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement