ZhouliProject/Zhouli.DAL/Interface/IBaseDAL.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Linq.Expressions;
namespace Zhouli.DAL.Interface
{
public interface IBaseDAL<T> where T : class
{
void Add(T t);
void AddRange(IEnumerable<T> t);
void Delete(T t);
void Delete(IEnumerable<T> t);
void Delete(Expression<Func<T, bool>> whereLambda);
void Update(T t);
int GetCount(Expression<Func<T, bool>> whereLambda);
int ExecuteSql(string sql, SqlParameter parameter = null);
IEnumerable<TR> SqlQuery<TR>(string sql);
IQueryable<T> GetModels(Expression<Func<T, bool>> whereLambda);
IQueryable<T> GetModelsByPage<type>(int pageSize, int pageIndex, bool isAsc, Expression<Func<T, type>> orderByLambda, Expression<Func<T, bool>> whereLambda);
/// <summary>
/// 一个业务中有可能涉及到对多张表的操作,那么可以将操作的数据,打上相应的标记,最后调用该方法,将数据一次性提交到数据库中,避免了多次链接数据库。
/// </summary>
bool SaveChanges();
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。