bklLiudl
2025-04-07 4e8f58cb41c7b6d570fd1979d80f74ab8a4d00c2
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
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> GetAllAsync();
 
        T GetOneById(int id);
        Task<T> GetOneByIdAsync(int id);
 
        List<T> GetModels(string sqlString);
 
        T GetModel(string sqlString);
        
        ISugarQueryable<T> GetAllWhereAsync(Expression<Func<T, bool>> predicate);
        ISugarQueryable<T> GeTAllByPageAsync(Expression<Func<T, bool>> predicate,int pageSize,int pageIndex, out int count);
        ISugarQueryable<T> GetAllByOrderAsync(Expression<Func<T, bool>> predicate, bool asc = true);
        ISugarQueryable<T> GetAllByOrderPageAsync(Expression<Func<T, bool>> predicate, int pageSize , int pageIndex , out int count,bool asc = true);
    }
}