/// <summary> /// Takes a document you want to modify and applies the update you have defined in MongoDb with lock. /// </summary> /// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <param name="documentToModify">The document you want to modify.</param> /// <param name="update">The update definition for the document.</param> public virtual bool UpdateOneOptimistic <TDocument>(TDocument documentToModify, UpdateDefinition <TDocument> update) where TDocument : IDocument <Guid> { return(MongoDbUpdater.UpdateOneOptimistic <TDocument, Guid>(documentToModify, update)); }
/// <summary> /// Updates the property field with the given value update a property field in entities. /// </summary> /// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <typeparam name="TField">The type of the field.</typeparam> /// <param name="documentToModify">The document you want to modify.</param> /// <param name="field">The field selector.</param> /// <param name="value">The new value of the property field.</param> public virtual bool UpdateOneOptimistic <TDocument, TField>(TDocument documentToModify, Expression <Func <TDocument, TField> > field, TField value) where TDocument : IDocument <Guid> { return(MongoDbUpdater.UpdateOneOptimistic <TDocument, Guid, TField>(documentToModify, field, value)); }
/// <summary> /// Updates a document with lock. /// </summary> /// <typeparam name="TDocument">The type representing a Document.</typeparam> /// <param name="modifiedDocument">The document with the modifications you want to persist.</param> public virtual bool UpdateOneOptimistic <TDocument>(TDocument modifiedDocument) where TDocument : IDocument <Guid> { return(MongoDbUpdater.UpdateOneOptimistic <TDocument, Guid>(modifiedDocument)); }