public static IEnumerable <ISiteConnectionString> TestAvaiilabilty(this IEnumerable <ISiteConnectionString> connectionStrings)
        {
            List <ISiteConnectionString> connectionstringList = new List <ISiteConnectionString>();
            List <Task> csTaskList = new List <Task>();

            foreach (ISiteConnectionString value in connectionStrings)
            {
                Task task = new Task(new Action(delegate
                {
                    try
                    {
                        ISiteConnectionString connectionString = value;
                        Stopwatch watcher = new Stopwatch();

                        watcher.Start();
                        XConsole.WriteLine("CheckSQLDatabaseAccesibility:" + connectionString.RawConnectionString);
                        bool isAvailable = WebOperations.CheckSQLDatabaseAccesibility(connectionString?.RawConnectionString);
                        watcher.Stop();

                        connectionString.IsAvailable  = isAvailable;
                        connectionString.ResponseTime = watcher.ElapsedMilliseconds;
                        connectionstringList.Add(connectionString);

                        watcher.Reset();

                        if (MultiThreading.ActiveTaskCounter > 0)
                        {
                            MultiThreading.ActiveTaskCounter--;
                        }
                    }
                    catch (Exception ex)
                    {
                        XConsole.WriteLine(ex.ToString());
                        logManager.Write(ex.ToString());
                    }
                }));
                csTaskList.Add(task);
            }
            MultiThreading.Run(csTaskList);
            return(connectionstringList.AsEnumerable());
        }
        public static void TestAvailability(object @value)
        {
            ISiteConnectionString connectionString = value as ISiteConnectionString;

            Stopwatch            watcher = new Stopwatch();
            SiteConnectionString connectionStringBlock = new SiteConnectionString();

            watcher.Start();
            bool isAvailable = WebOperations
                               .CheckSQLDatabaseAccesibility(connectionString.RawConnectionString);

            watcher.Stop();
            connectionStringBlock.IsAvailable   = isAvailable;
            connectionStringBlock.LastCheckTime = DateTime.Now;
            connectionStringBlock.ResponseTime  = watcher.ElapsedMilliseconds;

            watcher.Reset();

            if (MultiThreading.ActiveTaskCounter > 0)
            {
                MultiThreading.ActiveTaskCounter--;
            }
        }