接口文件
This commit is contained in:
40
Infrastructure/Hncore.Infrastructure/DDD/IQuery.cs
Normal file
40
Infrastructure/Hncore.Infrastructure/DDD/IQuery.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
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();
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user