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; }
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(); }