public AppViewModel() { _configManager = new ServiceConfigManager(); _certifyClient = new CertifyServiceClient(_configManager, GetDefaultServerConnection(_configManager)); Init(); }
/// <summary> /// Get the default connection for backend service /// </summary> /// <param name="configProvider"></param> /// <returns></returns> public ServerConnection GetDefaultServerConnection(IServiceConfigProvider configProvider) { var defaultConfig = new ServerConnection(GetAppServiceConfig()); var connections = ServerConnectionManager.GetServerConnections(Log, defaultConfig); if (connections.Any() && connections.Count() == 1) { ServerConnectionManager.Save(Log, connections); } return(connections.FirstOrDefault(c => c.IsDefault == true)); }