using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using JiShe.CollectBus.EntityFrameworkCore.Entities; namespace JiShe.CollectBus.EntityFrameworkCore.Repositories { public interface IRepository where TEntity : class, IEntity { IQueryable GetAll(params Expression>[] propertySelectors); IQueryable GetAll(Expression> expression, params Expression>[] propertySelectors); TEntity Find(TPrimaryKey id); Task FindAsync(TPrimaryKey id); TEntity Get(Expression> expression, params Expression>[] propertySelectors); Task GetAsync(Expression> expression, params Expression>[] propertySelectors); void Insert(TEntity entity, bool autoSave = true); Task InsertAsync(TEntity entity, bool autoSave = true); Task InsertAndGetIdAsync(TEntity entity, bool autoSave = true); void InsertList(List entities, bool autoSave = true); Task InsertListAsync(List entities, bool autoSave = true); void Update(TEntity entity, bool autoSave = true); Task UpdateAsync(TEntity entity, bool autoSave = true); void UpdateList(IEnumerable entities); Task UpdateListAsync(IEnumerable entities); void Delete(TPrimaryKey id, bool autoSave = true); Task DeleteAsync(TPrimaryKey id, bool autoSave = true); void Delete(TEntity entity, bool autoSave = true); Task DeleteAsync(TEntity entity, bool autoSave = true); void HardDelete(TPrimaryKey id, bool autoSave = true); Task HardDeleteAsync(TPrimaryKey id, bool autoSave = true); void HardDelete(TEntity entity, bool autoSave = true); Task HardDeleteAsync(TEntity entity, bool autoSave = true); } }