using System;
using System.Linq.Expressions;
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using MongoDbGenericRepository.Models;
namespace MongoDbGenericRepository.DataAccess.Base
{
public interface IDataAccessBase
{
///
/// Gets a IMongoQueryable for a potentially partitioned document type and a filter.
///
/// The document type.
/// The type of the primary key.
/// The filter definition.
/// The collection partition key.
///
IMongoQueryable GetQuery(Expression> filter, string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Gets a collections for a potentially partitioned document type.
///
/// The document type.
/// The type of the primary key.
/// The document.
///
IMongoCollection HandlePartitioned(TDocument document)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Gets a collections for a potentially partitioned document type.
///
/// The document type.
/// The type of the primary key.
/// The collection partition key.
///
IMongoCollection HandlePartitioned(string partitionKey)
where TDocument : IDocument
where TKey : IEquatable;
///
/// Gets a collections for the type TDocument with a partition key.
///
/// The document type.
/// The type of the primary key.
/// The collection partition key.
///
IMongoCollection GetCollection(string partitionKey = null)
where TDocument : IDocument
where TKey : IEquatable;
}
}