Пример #1
0
        protected override SqlReplicationConnections <SqlReplicationConnections.PredefinedSqlConnectionWithConfigurationOrigin> ApplyGlobalDocumentToLocal(SqlReplicationConnections <SqlReplicationConnections.PredefinedSqlConnectionWithConfigurationOrigin> global, SqlReplicationConnections <SqlReplicationConnections.PredefinedSqlConnectionWithConfigurationOrigin> local, DocumentDatabase systemDatabase, DocumentDatabase localDatabase)
        {
            local.PredefinedConnections = local.PredefinedConnections ?? global.PredefinedConnections;

            foreach (var localConnection in local.PredefinedConnections)
            {
                localConnection.HasLocal = true;
            }

            foreach (var globalConnection in global.PredefinedConnections)
            {
                globalConnection.HasGlobal = true;

                var localConnection = local.PredefinedConnections.FirstOrDefault(x => string.Equals(x.Name, globalConnection.Name, StringComparison.OrdinalIgnoreCase));
                if (localConnection != null)
                {
                    localConnection.HasGlobal = true;
                    continue;
                }

                local.PredefinedConnections.Add(globalConnection);
            }

            return(local);
        }
Пример #2
0
        protected override SqlReplicationConnections <SqlReplicationConnections.PredefinedSqlConnectionWithConfigurationOrigin> ConvertGlobalDocumentToLocal(SqlReplicationConnections <SqlReplicationConnections.PredefinedSqlConnectionWithConfigurationOrigin> global, DocumentDatabase systemDatabase, DocumentDatabase localDatabase)
        {
            foreach (var localConnection in global.PredefinedConnections)
            {
                localConnection.HasLocal  = false;
                localConnection.HasGlobal = true;
            }

            return(global);
        }
 protected override SqlReplicationConnections <SqlReplicationConnections.PredefinedSqlConnectionWithConfigurationOrigin> PostProcessLocalOnly(SqlReplicationConnections <SqlReplicationConnections.PredefinedSqlConnectionWithConfigurationOrigin> local)
 {
     foreach (var predefinedSqlConnectionWithConfigurationOrigin in local.PredefinedConnections)
     {
         predefinedSqlConnectionWithConfigurationOrigin.HasLocal = true;
     }
     return(local);
 }