public static Package GetTestPackage() { Package returnObj; IFbService client = null; var myChannelFactory = GetClient(); try { client = myChannelFactory.CreateChannel(); returnObj = client.GetTestPackage(); // ReSharper disable once SuspiciousTypeConversion.Global ((ICommunicationObject)client).Close(); } catch (Exception ex) { if (client != null) { // ReSharper disable once SuspiciousTypeConversion.Global ((ICommunicationObject)client).Abort(); } throw new Exception("Failed during service call--" + ex.InnerException.Message, ex); } return(returnObj); }
public ExternalAuthService(AuthorizationUnitOfWork db, ConnectionsHub hub, IVkService vkService, IFbService fbService, ILogger <ExternalAuthService> logger, MediaConverter mediaConverter) { Db = db; Hub = hub; VkService = vkService; FbService = fbService; Logger = logger; MediaConverter = mediaConverter; }
public AccountService(AccountDataUnitOfWork accountDb, ConnectionsHub hub, IVkService vkService, IFbService fbService, ILogger <AccountService> logger, MediaConverter mediaConverter) { Db = accountDb; Hub = hub; VkService = vkService; FbService = fbService; Logger = logger; MediaConverter = mediaConverter; }
public static void InsertNewMethodLog(string methodName, string token) { IFbService client = null; var myChannelFactory = GetClient(); try { client = myChannelFactory.CreateChannel(); client.InsertNewMethodLog(methodName, token); // ReSharper disable once SuspiciousTypeConversion.Global ((ICommunicationObject)client).Close(); } catch { if (client != null) { // ReSharper disable once SuspiciousTypeConversion.Global ((ICommunicationObject)client).Abort(); } } }
public static void Done() { IFbService client = null; var myChannelFactory = GetClient(); try { client = myChannelFactory.CreateChannel(); client.Done(); // ReSharper disable once SuspiciousTypeConversion.Global ((ICommunicationObject)client).Close(); } catch { if (client != null) { // ReSharper disable once SuspiciousTypeConversion.Global ((ICommunicationObject)client).Abort(); } } }
public static void UpdateMethodLog(string token, string methodName, MethodStatus status, long?timeTaken = null, string error = null) { IFbService client = null; var myChannelFactory = GetClient(); try { client = myChannelFactory.CreateChannel(); client.UpdateMethodLog(token, methodName, status, timeTaken, error + " - From " + Environment.MachineName); // ReSharper disable once SuspiciousTypeConversion.Global ((ICommunicationObject)client).Close(); } catch { if (client != null) { // ReSharper disable once SuspiciousTypeConversion.Global ((ICommunicationObject)client).Abort(); } } }