using MongoDB.Driver;
using MongoDbGenericRepository.Models;
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace MongoDbGenericRepository
{
///
/// The IBaseMongoRepository_Update interface exposing update functionality for documents with Guid Ids.
///
public interface IBaseMongoRepository_Update : IBaseMongoRepository_Update
{
///
/// Asynchronously Updates a document.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The document with the modifications you want to persist.
Task UpdateOneAsync(TDocument modifiedDocument)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Updates a document.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The document with the modifications you want to persist.
bool UpdateOne(TDocument modifiedDocument)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Takes a document you want to modify and applies the update you have defined in MongoDb.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The document you want to modify.
/// The update definition for the document.
Task UpdateOneAsync(TDocument documentToModify, UpdateDefinition update)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Takes a document you want to modify and applies the update you have defined in MongoDb.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The document you want to modify.
/// The update definition for the document.
bool UpdateOne(TDocument documentToModify, UpdateDefinition update)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entity selected by the filter, updates the property field with the given value..
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document filter.
/// The field selector.
/// The new value of the property field.
/// The partition key for the document.
bool UpdateOne(Expression> filter, Expression> field, TField value, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Updates the property field with the given value update a property field in entities.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document you want to modify.
/// The field selector.
/// The new value of the property field.
Task UpdateOneAsync(TDocument documentToModify, Expression> field, TField value)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entity selected by the filter, updates the property field with the given value.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document filter.
/// The field selector.
/// The new value of the property field.
/// The partition key for the document.
Task UpdateOneAsync(Expression> filter, Expression> field, TField value, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Updates the property field with the given value update a property field in entities.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document you want to modify.
/// The field selector.
/// The new value of the property field.
bool UpdateOne(TDocument documentToModify, Expression> field, TField value)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Updates the property field with the given value update a property field in entities.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document filter.
/// The field selector.
/// The new value of the property field.
/// The value of the partition key.
Task UpdateOneAsync(FilterDefinition filter, Expression> field, TField value, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Updates the property field with the given value update a property field in entities.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document filter.
/// The field selector.
/// The new value of the property field.
/// The value of the partition key.
bool UpdateOne(FilterDefinition filter, Expression> field, TField value, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entities selected by the filter, updates the property field with the given value.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document filter.
/// The field selector.
/// The new value of the property field.
/// The partition key for the document.
Task UpdateManyAsync(Expression> filter, Expression> field, TField value, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entities selected by the filter, updates the property field with the given value.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document filter.
/// The field selector.
/// The new value of the property field.
/// The value of the partition key.
Task UpdateManyAsync(FilterDefinition filter, Expression> field, TField value, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entities selected by the filter, applies the update you have defined in MongoDb.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The document filter.
/// The update definition to apply.
/// The value of the partition key.
Task UpdateManyAsync(FilterDefinition filter, UpdateDefinition updateDefinition, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entities selected by the filter, applies the update you have defined in MongoDb.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The document filter.
/// The update definition to apply.
/// The value of the partition key.
Task UpdateManyAsync(Expression> filter, UpdateDefinition updateDefinition, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entities selected by the filter, updates the property field with the given value.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document filter.
/// The field selector.
/// The new value of the property field.
/// The partition key for the document.
long UpdateMany(Expression> filter, Expression> field, TField value, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entities selected by the filter, updates the property field with the given value.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The type of the field.
/// The document filter.
/// The field selector.
/// The new value of the property field.
/// The value of the partition key.
long UpdateMany(FilterDefinition filter, Expression> field, TField value, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entities selected by the filter, applies the update you have defined in MongoDb.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The document filter.
/// The update definition to apply.
/// The value of the partition key.
long UpdateMany(Expression> filter, UpdateDefinition updateDefinition, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// For the entities selected by the filter, applies the update you have defined in MongoDb.
///
/// The type representing a Document.
/// The type of the primary key for a Document.
/// The document filter.
/// The update definition to apply.
/// The value of the partition key.
long UpdateMany(FilterDefinition filter, UpdateDefinition updateDefinition, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
}
}