接口文件

This commit is contained in:
“wanyongkang”
2024-04-10 13:55:27 +08:00
parent fff6bee06a
commit ed3b2c653e
3190 changed files with 268248 additions and 1 deletions

View 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();
}
}