1:IBaseDAL
1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Linq.Expressions; 5 using System.Text; 6 using System.Threading.Tasks; 7 8 namespace C01.ZRF.IDAL 9 { 10 public interface IBaseDAL<T> where T : class 11 { 12 13 int SaveChanges(); 14 15 void Add(T model); 16 17 void Delete(T model); 18 19 void DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> delWhere); 20 21 void Modify(T model, params string[] propertyNames); 22 23 IQueryable<T> Where(Expression<Func<T, bool>> whereLambda); 24 25 IQueryable<T> WhereOrder<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true); 26 27 IQueryable<T> WhereInclude(Expression<Func<T, bool>> whereLambda, params string[] includePropertyNames); 28 29 IQueryable<T> WhereInclude<TKey>(Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames); 30 31 IEnumerable<T> WherePaged<TKey>(int PageIndex, int PageSize, out int totalCount, Expression<Func<T, bool>> whereLambda, Expression<Func<T, TKey>> keySelector, bool isAsc = true, params string[] includePropertyNames); 32 33 IQueryable<T> QueryBySql(string sql, params System.Data.SqlClient.SqlParameter[] ps); 34 } 35 }