using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading.Tasks; namespace HRD.WebApi.Repositories { public interface IBaseRepositoryCore { bool Add(T entity, bool saveEntity = true); Task AddAsync(T entity, bool saveEntity = true); Task AddListAsync(List list, bool saveEntity = true); bool Delete(T entity); Task DeleteAsync(T entity, bool saveEntity = true); Task DeleteByIdAsync(int Id, bool saveEntity = true); Task DeleteFromTableAsync(string tablename, string whereClause = ""); bool Detach(T entity, bool saveChanges = true); Task DetachAsync(T entity, bool saveChanges = true); Task ExecStoredProcedureAsync(string storedProcedureName, string param = ""); List GetAll(bool asNoTracking = true); List TakeList(int count, bool asNoTracking = true); Task> TakeListAsync(int count, bool asNoTracking = true); Task> GetAllAsync(bool asNoTracking = true); List GetBy(Expression> expression, bool asNoTracking = true); Task GetByAsync(Expression> expression, bool asNoTracking = true); Task GetByIdAsync(int entityId, bool asNoTracking = false); Task GetBySqlAsync(string str, bool asNoTracking = true); Task GetByWithIncludeAsync(Expression> expression, string navigationPropertyPath, bool asNoTracking = true); Task> GetListByAsync(Expression> expression, bool asNoTracking = true); Task> GetListByConditionFromSqlAsync(string str); string GetTableName(); bool SaveChanges(); Task SaveChangesAsync(); bool Update(T entity); Task UpdateAsync(T entity, bool saveEntity = true); Task UpdateListAsync(List entity, bool saveEntity = true); Task> TakePagesListAsync(int pageNumber, int pageSize, bool asNoTracking = true); } }