using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Hncore.Infrastructure.DDD { public interface IRepository where TEntity : IEntity { TEntity FindById(TId id); Task FindByIdAsync(TId id); void Add(TEntity entity); Task AddAsync(TEntity entity); /// /// 批量添加 /// /// void AddRange(List entity); /// /// 批量添加 /// /// Task AddRangeAsync(List entity); /// /// 批量修改 /// /// void UpdateRange(List entity); /// /// 批量删除 /// /// void RemoveRange(List entity); void Remove(TEntity entity); void Update(TEntity entity); IQueryable GetQueryable(); } }