添加项目文件。

This commit is contained in:
zgf committed 2023-07-25 19:20:18 +08:00
1 parent 05e131ca4e
commit 514d6f5255
1162 files changed
+81255

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
using System;
using System.Linq;
using System.Linq.Expressions;
namespace HHWMS.Web
{
public interface IUnitWork
{
T FindSingle<T>(Expression<Func<T, bool>> where) where T : class;
T FindById<T>(Guid id) where T : class;
T FindById<T>(int id) where T : class;
IQueryable<T> Find<T>(Expression<Func<T, bool>> where) where T : class;
bool IsExit<T>(Expression<Func<T, bool>> where) where T : class;
int GetCount<T>(Expression<Func<T, bool>> where) where T : class;
int Add<T>(T entity) where T : class;
int BatchAdd<T>(T[] entities) where T : class;
/// <summary>
/// 添加到历史表,并将原数据删除
/// </summary>
/// <param name="name">历史表 表名</param>
/// <param name="where">条件</param>
/// <param name="entity">实体类</param>
/// <returns></returns>
int AddToHistory<T>(string name, Expression<Func<T, bool>> where, Expression<Func<T, object>> entity) where T : class;
int Update<T>(T entity) where T : class;
/// <summary>
/// 根据条件更新
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="where"></param>
/// <param name="entity"></param>
/// <returns></returns>
int BatchUpdate<T>(Expression<Func<T, bool>> where, Expression<Func<T, T>> entity) where T : class;
int Delete<T>(T entity) where T : class;
/// <summary>
/// 根据条件 批量删除
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="where">条件</param>
/// <returns></returns>
int BatchDelete<T>(Expression<Func<T, bool>> where) where T : class;
int DeleteById<T>(T entity) where T : class;
int DeleteById<T>(int id) where T : class;
int BatchDelete<T>(T[] entities) where T : class;
string GetSerialNumber(string prefix, int length = 4);
}
}