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);
|
}
|
}
|