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