/*--------------------------------------------------------------------------------------------*/
        /// <summary />
        public FabricClient(string pConfigKey)
        {
            if (!IsInit)
            {
                throw new Exception("FabricClient.InitOnce() has not been called yet.");
            }

            if (!ConfigMap.ContainsKey(pConfigKey))
            {
                throw new Exception("Configuration not found for configKey '" + pConfigKey + "'.");
            }

            IFabricClientConfig config = ConfigMap[pConfigKey];

            Context         = new ClientContext(config);
            Context.AppSess = AppSessMap[pConfigKey];
            Context.LogInfo("New FabricClient");

            Services = new FabricServices(Context);
        }
        /*--------------------------------------------------------------------------------------------*/
        private static void AttachNewConfigGroup(IFabricClientConfig pConfig)
        {
            if (pConfig == null)
            {
                throw new Exception("The provided IFabricClientConfig is null.");
            }

            if (ConfigMap.ContainsKey(pConfig.ConfigKey))
            {
                throw new Exception("The configKey '" + pConfig.ConfigKey + "' is already in use.");
            }

            ConfigMap.Add(pConfig.ConfigKey, pConfig);

            var context  = new ClientContext(pConfig);
            var services = new FabricServices(context);
            var appSess  = new AppSession(pConfig, services.Oauth);

            context.AppSess = appSess;
            AppSessMap[pConfig.ConfigKey] = appSess;

            ApiVersion = services.ApiVersion;
        }