コード例 #1
0
        private RavenServerEditModel GetOrAddServer(RavenStoreEditModel store, string serverName)
        {
            var server = store.Servers.SelectByName(serverName);
            if (server == null)
            {
                server = new RavenServerEditModel { Name = serverName };
                store.Servers.Add(server);
            }

            this.EnsureAllReplicationDestinationsExist(server);

            return server;
        }
コード例 #2
0
 private void EnsureAllReplicationDestinationsExist(RavenServerEditModel server)
 {
     foreach (var serverName in this.GetAllServerNames())
     {
         if (server.ReplicationDestinations.SelectByName(serverName) == null)
         {
             server.ReplicationDestinations.Add(
                 new RavenReplicationDestinationEditModel
                 {
                     Name = serverName
                 });
         }
     }
     server.ReplicationDestinations = server.ReplicationDestinations.OrderByName();
 }