forked from anjoy8/Blog.Core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIBaseRepository.cs
More file actions
47 lines (34 loc) · 1.98 KB
/
IBaseRepository.cs
File metadata and controls
47 lines (34 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace Blog.Core.IRepository.Base
{
public interface IBaseRepository<TEntity> where TEntity : class
{
Task<TEntity> QueryByID(object objId);
Task<TEntity> QueryByID(object objId, bool blnUseCache = false);
Task<List<TEntity>> QueryByIDs(object[] lstIds);
Task<int> Add(TEntity model);
Task<bool> DeleteById(object id);
Task<bool> Delete(TEntity model);
Task<bool> DeleteByIds(object[] ids);
Task<bool> Update(TEntity model);
Task<bool> Update(TEntity entity, string strWhere);
Task<bool> Update(TEntity entity, List<string> lstColumns = null, List<string> lstIgnoreColumns = null, string strWhere = "");
Task<List<TEntity>> Query();
Task<List<TEntity>> Query(string strWhere);
Task<List<TEntity>> Query(Expression<Func<TEntity, bool>> whereExpression);
Task<List<TEntity>> Query(Expression<Func<TEntity, bool>> whereExpression, string strOrderByFileds);
Task<List<TEntity>> Query(Expression<Func<TEntity, bool>> whereExpression, Expression<Func<TEntity, object>> orderByExpression, bool isAsc = true);
Task<List<TEntity>> Query(string strWhere, string strOrderByFileds);
Task<List<TEntity>> Query(Expression<Func<TEntity, bool>> whereExpression, int intTop, string strOrderByFileds);
Task<List<TEntity>> Query(string strWhere, int intTop, string strOrderByFileds);
Task<List<TEntity>> Query(
Expression<Func<TEntity, bool>> whereExpression, int intPageIndex, int intPageSize, string strOrderByFileds);
Task<List<TEntity>> Query(string strWhere, int intPageIndex, int intPageSize, string strOrderByFileds);
Task<List<TEntity>> QueryPage(Expression<Func<TEntity, bool>> whereExpression, int intPageIndex = 0, int intPageSize = 20, string strOrderByFileds = null);
}
}