Beispiel #1
0
        /// <summary>
        /// Saves document to collection using specified key.
        /// If document with such key already exists, it will be silently overwritten.
        /// </summary>
        public bool Save(String key, Object document)
        {
            if (key == null)
            {
                throw new ArgumentNullException("key");
            }
            if (document == null)
            {
                throw new ArgumentNullException("document");
            }

            _metadata.SetDocumentId(document, key);
            _collection.Save(_documentType, document);
            return(true);
        }