Beispiel #1
0
        public Task <DocumentInfo> SaveDocument(Document document, bool overwriteConcurrentUpdates)
        {
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }
            if (document.Id.HasNoValue())
            {
                throw new ArgumentException("Document ID should not be empty or null.", "document");
            }

            using (SyncContext.SwitchToDefault())
                return(SaveDocumentTask.Start(this, document, overwriteConcurrentUpdates));
        }
Beispiel #2
0
            public static Task <DocumentInfo> Start(DatabaseApi parent, Document document, bool overwriteConcurrentUpdates)
            {
                var saver = new SaveDocumentTask(parent, document, overwriteConcurrentUpdates);

                return(overwriteConcurrentUpdates ? saver.SaveOverriding() : saver.Save());
            }
			public static Task<DocumentInfo> Start(DatabaseApi parent, Document document, bool overwriteConcurrentUpdates)
			{
				var saver = new SaveDocumentTask(parent, document, overwriteConcurrentUpdates);
				return overwriteConcurrentUpdates ? saver.SaveOverriding() : saver.Save();
			}