Administrator
2025-05-08 0d794d748f61b5c719d665bfcae24a4d9b2b6224
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
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using SqlSugar;
using WMS.Entity;
 
namespace WMS.IDAL
{
    public interface IBaseRepository<T> where T : BaseEntity
    {
        int Add(T t);
        Task<int> AddAsync(T t);
 
        int Edit(T t);
        Task<int> EditAsync(T t);
 
        int Remove(int id,int userId = 0);
        Task<int> RemoveAsync(int id ,int userId = 0);
 
        int Remove(T t,int userId = 0);
        Task<int> RemoveAsync(T t, int userId = 0);
 
        int RemoveAll(List<T> t, int userId = 0);
        Task<int> RemoveAllAsync(List<T> t,int userId = 0);
 
        void Save();
        Task SaveAsync();
 
 
        ISugarQueryable<T> GetAll();
        Task<List<T>> GetAllAsync();
        T GetOneById(int id);
        Task<T> GetOneByIdAsync(int id);
        Task<T> GetOneByIdAsync1(int id);
 
        List<T> GetModels(string sqlString);
 
        T GetModel(string sqlString);
        
        ISugarQueryable<T> GetAllWhere(Expression<Func<T, bool>> predicate);
        ISugarQueryable<T> GeTAllByPage(Expression<Func<T, bool>> predicate,int pageSize,int pageIndex, out int count);
        ISugarQueryable<T> GetAllByOrder(Expression<Func<T, bool>> predicate, bool asc = true);
        ISugarQueryable<T> GetAllByOrderPage(Expression<Func<T, bool>> predicate, int pageSize , int pageIndex , out int count,bool asc = true);
    }
}