Ejemplo n.º 1
0
        public override void LoadFor(DatabaseDocument document)
        {
            DatabaseDocument = document;
            var session = ApplicationModel.Current.Server.Value.DocumentStore.OpenAsyncSession(ApplicationModel.Current.Server.Value.SelectedDatabase.Value.Name);

            session.Advanced.LoadStartingWithAsync <VersioningConfiguration>("Raven/Versioning").
            ContinueOnSuccessInTheUIThread(data =>
            {
                VersioningConfigurations.Clear();
                OriginalVersioningConfigurations.Clear();
                var versioningConfigurations = data as VersioningConfiguration[] ?? data.ToArray();
                foreach (var versioningConfiguration in versioningConfigurations)
                {
                    VersioningConfigurations.Add(versioningConfiguration);
                    OriginalVersioningConfigurations.Add(versioningConfiguration);
                }
            });
        }
        public override void LoadFor(DatabaseDocument databaseDocument)
        {
            var session = ApplicationModel.Current.Server.Value.DocumentStore.OpenAsyncSession(databaseDocument.Id);

            session.Advanced.LoadStartingWithAsync <VersioningConfiguration>("Raven/Versioning").
            ContinueOnSuccessInTheUIThread(data =>
            {
                VersioningConfigurations.Clear();
                foreach (var versioningConfiguration in data)
                {
                    VersioningConfigurations.Add(versioningConfiguration);
                }
                foreach (var versioningConfiguration in data)
                {
                    OriginalVersioningConfigurations.Add(versioningConfiguration);
                }
            });
        }