| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 | 
							- using Data.Repository;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Linq.Expressions;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- using Common;
 
- using Common.Models;
 
- namespace Services.DAL
 
- {
 
-     public class CommonDAL : Repositor
 
-     {
 
-         #region 查询
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PaginationDTO<IEnumerable<T>> FindPageList<T>(Expression<Func<T, bool>> condition, PaginationQuery pagination) where T : class, new()
 
-         {
 
-             return db.FindPageList<T>(condition, pagination);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public IEnumerable<T> FindList<T>(Expression<Func<T, bool>> condition) where T : class, new()
 
-         {
 
-             return db.FindList<T>(condition);
 
-         }
 
-        
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public T FindEntity<T>(Expression<Func<T, bool>> condition) where T : class, new()
 
-         {
 
-             return db.FindEntity<T>(condition);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public int Count<T>(Expression<Func<T, bool>> condition) where T : class, new()
 
-         {
 
-             return db.Count<T>(condition);
 
-         }
 
-         
 
-         #endregion
 
-         #region sql查询
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public PaginationDTO<IEnumerable<T>> FindPageList<T>(string sql, PaginationQuery pagination, object para = null) where T : class, new()
 
-         {
 
-             return db.FindPageList<T>(sql, pagination, para);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public T FindEntity<T>(string sql, object para = null) where T : class, new()
 
-         {
 
-             return db.FindEntity<T>(sql, para);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public IEnumerable<T> FindList<T>(string sql, object para = null) where T : class, new()
 
-         {
 
-             return db.FindList<T>(sql, para);
 
-         }
 
-         #endregion
 
-         #region 编辑
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public int Insert<T>(T model) where T : class, new()
 
-         {
 
-             return db.Insert<T>(model);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public int Insert<T>(List<T> list) where T : class, new()
 
-         {
 
-             return db.Insert<T>(list);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public int Update<T>(T model) where T : class, new()
 
-         {
 
-             return db.Update<T>(model);
 
-         }
 
-         #endregion
 
-         #region 删除
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public int Delete<T>(T model) where T : class, new()
 
-         {
 
-             return db.Delete<T>(model);
 
-         }
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         
 
-         public int Delete<T>(int id) where T : class, new()
 
-         {
 
-             return db.Delete<T>(id);
 
-         }
 
-         #endregion
 
-     }
 
- }
 
 
  |