Exemplo n.º 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));
        }
Exemplo n.º 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());
            }
Exemplo n.º 3
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();
			}