123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274 |
- using Microsoft.EntityFrameworkCore;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Data.SqlClient;
- using System.Linq.Expressions;
- using System.Threading.Tasks;
- namespace Repository
- {
- public interface IRepository
- {
- DbContext GetCurrentDbContext();
-
-
-
-
-
-
- bool Add<T>(T entity) where T : class;
-
-
-
-
-
-
- Task<bool> AddAsync<T>(T entity) where T : class;
-
-
-
-
-
-
- bool AddRange<T>(IEnumerable<T> entity) where T : class;
-
-
-
-
-
-
- Task<bool> AddRangeAsync<T>(IEnumerable<T> entity) where T : class;
-
-
-
-
-
-
- bool Delete<T>(T entity) where T : class;
-
-
-
-
-
- bool DeleteAll<T>() where T : class;
-
-
-
-
-
- Task<bool> DeleteAllAsync<T>() where T : class;
-
-
-
-
-
-
- bool Delete<T>(Expression<Func<T, bool>> whereLambda) where T : class;
-
-
-
-
-
-
- Task<bool> DeleteAsync<T>(Expression<Func<T, bool>> whereLambda) where T : class;
- bool DeleteById<T>(dynamic id) where T : class;
- Task<bool> DeleteByIdAsync<T>(dynamic id) where T : class;
-
-
-
-
-
-
- bool Update<T>(T entity) where T : class;
- Task<bool> UpdateAsync<T>(T entity) where T : class;
-
-
-
-
-
-
-
-
- bool Update<T>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, T>> updateLambda) where T : class;
-
-
-
-
-
-
-
-
- Task<bool> UpdateAsync<T>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, T>> updateLambda) where T : class;
-
-
-
-
-
-
- bool Update<T>(List<T> entity) where T : class;
-
-
-
-
-
-
-
-
- bool Update<T>(T model, Expression<Func<T, bool>> whereLambda, params string[] modifiedProNames) where T : class;
-
-
-
-
-
-
- T FindById<T>(dynamic id) where T : class;
-
-
-
-
-
-
- Task<T> FindByIdAsync<T>(dynamic id) where T : class;
-
-
-
-
-
-
- T GetFirstDefault<T>(Expression<Func<T, bool>> whereLambda = null) where T : class;
- Task<T> GetFirstDefaultAsync<T>(Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
- List<T> GetAll<T>(string orderProperty) where T : class;
-
-
-
-
-
- Task<List<T>> GetAllAsync<T>(string orderProperty) where T : class;
-
-
-
-
-
-
-
- List<T> GetAllQuery<T>(string path,Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
-
- List<T> GetAllQuery<T>(Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
-
- Task<List<T>> GetAllQueryAsync<T>(Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
-
- int GetCount<T>(Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
-
- Task<int> GetCountAsync<T>(Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
-
- bool GetAny<T>(Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
-
- Task<bool> GetAnyAsync<T>(Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
-
-
-
-
-
-
- List<T> Pagination<T, TKey>(int pageIndex, int pageSize, Expression<Func<T, TKey>> orderBy, Expression<Func<T, bool>> whereLambda = null, bool isOrder = true) where T : class;
-
-
-
-
-
-
-
-
-
-
-
- Task<List<T>> PaginationAsync<T, TKey>(int pageIndex, int pageSize, Expression<Func<T, TKey>> orderBy,
- Expression<Func<T, bool>> whereLambda = null, bool isOrder = true) where T : class;
-
-
-
-
-
-
-
-
-
- List<T> Pagination<T>(int pageIndex, int pageSize, string ordering, Expression<Func<T, bool>> whereLambda = null) where T : class;
-
-
-
-
-
-
- List<T> GetSelect<T>(Expression<Func<T, bool>> whereLambda) where T : class;
-
-
-
-
-
-
-
-
- List<T> QueryPro<T>(string sql, List<SqlParameter> parameters, CommandType cmdType = CommandType.Text) where T : class;
-
-
-
-
- void RollBackChanges<T>() where T : class;
- }
- }
|