2020-12-28 14:55:48 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Linq.Expressions;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Hncore.Infrastructure.Data;
|
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Hncore.Infrastructure.DDD
|
|
|
|
|
|
{
|
|
|
|
|
|
public interface IQuery<TEntity,TId> where TEntity : IEntity<TId>
|
|
|
|
|
|
{
|
|
|
|
|
|
TEntity GetOne(Expression<Func<TEntity, bool>> condition);
|
|
|
|
|
|
|
|
|
|
|
|
Task<TEntity> GetOneAsync(Expression<Func<TEntity, bool>> condition);
|
|
|
|
|
|
|
|
|
|
|
|
PageData<TEntity> GetList(Expression<Func<TEntity, bool>> condition, int pagesize, int pageindex, bool istotal);
|
|
|
|
|
|
|
|
|
|
|
|
Task<PageData<TEntity>> GetListAsync(Expression<Func<TEntity, bool>> condition, int pagesize, int pageindex, bool istotal);
|
|
|
|
|
|
|
|
|
|
|
|
List<TEntity> GetList(Expression<Func<TEntity, bool>> condition);
|
|
|
|
|
|
|
|
|
|
|
|
Task<List<TEntity>> GetListAsync(Expression<Func<TEntity, bool>> condition);
|
|
|
|
|
|
|
|
|
|
|
|
bool Exists(Expression<Func<TEntity, bool>> condition);
|
|
|
|
|
|
|
|
|
|
|
|
Task<bool> ExistsAsync(Expression<Func<TEntity, bool>> condition);
|
|
|
|
|
|
|
|
|
|
|
|
List<TEntity> TopN(Expression<Func<TEntity, bool>> condition, int topN);
|
|
|
|
|
|
|
|
|
|
|
|
Task<List<TEntity>> TopNAsync(Expression<Func<TEntity, bool>> condition, int topN);
|
|
|
|
|
|
|
|
|
|
|
|
IQueryable<TEntity> GetListQueryable(Expression<Func<TEntity, bool>> condition);
|
|
|
|
|
|
|
|
|
|
|
|
IQueryable<TEntity> GetQueryable();
|
|
|
|
|
|
|
|
|
|
|
|
DbContext DbContext();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|