Brnkly.Raven.Admin.Controllers.ReplicationController.Live C# (CSharp) Method

Live() private method

private Live ( [ etag ) : HttpResponseMessage
etag [
return System.Net.Http.HttpResponseMessage
        public HttpResponseMessage Live([FromBody]Guid etag)
        {
            var config = this.LoadConfig();
            ThrowIfEtagDoesNotMatch(config.Pending, etag);

            config.Live.Stores.Clear();
            foreach (var store in config.Pending.Stores)
            {
                config.Live.Stores.Add(store);
            }

            this.RavenSession.Store(config.Live, RavenConfig.LiveDocumentId);
            this.RavenSession.SaveChanges();

            var errors = new List<string>();
            foreach (var store in config.Live.Stores)
            {
                errors.AddRange(this.RavenHelper.UpdateReplicationDocuments(store));
            }

            // TODO: Add errors to response.

            var newEtag = this.RavenSession.Advanced.GetEtagFor(config.Live).Value;
            return GetCreatedResponse(newEtag);
        }

Same methods

ReplicationController::Live ( ) : RavenConfigModel