22 lines
756 B
C#
22 lines
756 B
C#
using System.Linq.Expressions;
|
|
using MongoDB.Driver;
|
|
using Web.Core.Model.Entity;
|
|
|
|
namespace Web.Core.Common.MongoDB;
|
|
|
|
public interface IMongoDBHelper<T> where T : MDBBaseEntity
|
|
{
|
|
public IList<T> Find(string collName, Expression<Func<T, bool>> match, string sortPropertyName,
|
|
bool isDescending = true);
|
|
|
|
public IList<T> Find(string collName, FilterDefinition<T> query, string sortPropertyName, bool isDescending = true);
|
|
|
|
public Task<IList<T>> FindAsync(string collName, FilterDefinition<T> query);
|
|
|
|
public IList<T> Find<TKey>(string collName, Expression<Func<T, bool>> match,
|
|
Expression<Func<T, TKey>> orderByProperty, bool isDescending = true);
|
|
|
|
public T FindSingle(string collName, FilterDefinition<T> filter);
|
|
}
|
|
|