Ejemplo n.º 1
0
        private void InitializeSlaveServers(SlaveConnectionStringCollection slaves)
        {
            Check.NotNull(slaves);
            SlaveConnectionStringElement[] elements = slaves.OfType <SlaveConnectionStringElement>().OrderBy(item => item.Order).ToArray();
            Check.NotEmpty(elements);

            this._slaves = new DbSlaveServerCollection();
            for (int i = 0; i < elements.Length; i++)
            {
                SlaveConnectionStringElement element = elements[i];
                DbSlaveServer slave = new DbSlaveServer(element.ConnectionString, i);
                this._slaves.Add(slave);
            }
        }
        private void InitializeSlaveServers(SlaveConnectionStringCollection slaves)
        {
            Check.NotNull(slaves);
            SlaveConnectionStringElement[] elements = slaves.OfType<SlaveConnectionStringElement>().OrderBy(item => item.Order).ToArray();
            Check.NotEmpty(elements);

            this._slaves = new DbSlaveServerCollection();
            for (int i = 0; i < elements.Length; i++)
            {
                SlaveConnectionStringElement element = elements[i];
                DbSlaveServer slave = new DbSlaveServer(element.ConnectionString, i);
                this._slaves.Add(slave);
            }
        }