Exemplo n.º 1
0
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="dataAry"></param>
 public static void Delete <T>(params T[] dataAry)
 {
     Static.Remove(dataAry);
 }
Exemplo n.º 2
0
 /// <summary>
 /// 修改数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="oldEntity"></param>
 /// <param name="newEntity"></param>
 public static void Update <T>(Func <T, bool> where, T newEntity)
 {
     Static.Update(where, newEntity);
 }
Exemplo n.º 3
0
 /// <summary>
 /// 新增数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="data"></param>
 public static void Add <T>(T data)
 {
     Static.Add(data);
 }
Exemplo n.º 4
0
 /// <summary>
 /// 删除数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="where"></param>
 public static void Remove <T>(Func <T, bool> where)
 {
     Static.Remove(where);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 获取第一条
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="where"></param>
 /// <returns></returns>
 public static T FirstOrDefault <T>(Func <T, bool> where)
 {
     return(Static.FirstOrDefault(where));
 }
Exemplo n.º 6
0
 /// <summary>
 /// 查询数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="where"></param>
 /// <returns></returns>
 public static IEnumerable <T> Select <T>(Func <T, bool> where)
 {
     return(Static.Where(where));
 }
Exemplo n.º 7
0
 /// <summary>
 /// 数据初始化
 /// </summary>
 /// <param name="dataAssemblyName">数据模型所在程序集名   默认当前项目所在程序集</param>
 public static void Start(string dataAssemblyName = "")
 {
     //数据初始化
     Static.Start(dataAssemblyName);
 }
Exemplo n.º 8
0
 /// <summary>
 /// 是否存在
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="where"></param>
 /// <returns></returns>
 public static bool Any <T>(Func <T, bool> where)
 {
     return(Static.Any(where));
 }
Exemplo n.º 9
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <param name="pageCount"></param>
 /// <returns></returns>
 public static List <T> GetList <T>(int pageIndex, int pageSize, out int pageCount)
 {
     return(Static.GetList <T>(pageIndex, pageSize, out pageCount));
 }
Exemplo n.º 10
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="where"></param>
 /// <param name="pageIndex"></param>
 /// <param name="pageSize"></param>
 /// <param name="pageCount"></param>
 /// <returns></returns>
 public static List <T> GetList <T>(Func <T, bool> where, int pageIndex, int pageSize, out int pageCount)
 {
     return(Static.GetList(where, pageIndex, pageSize, out pageCount));
 }
Exemplo n.º 11
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <returns></returns>
 public static List <T> GetList <T>()
 {
     return(Static.GetList <T>());
 }
Exemplo n.º 12
0
 /// <summary>
 /// 更新数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="where"></param>
 /// <param name="entity"></param>
 public void Update <T>(Func <T, bool> where, T entity)
 {
     Static.Update(where, entity);
 }
Exemplo n.º 13
0
 /// <summary>
 /// 移除数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="data"></param>
 public void Remove <T>(params T[] data)
 {
     Static.Remove(data);
 }
Exemplo n.º 14
0
 /// <summary>
 /// 新增数据
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="data"></param>
 public void Add <T>(params T[] data)
 {
     Static.Add(data);
 }
Exemplo n.º 15
0
 /// <summary>
 /// 数据初始化
 /// </summary>
 /// <param name="dataAssemblyName">数据模型所在程序集名   默认当前项目所在程序集</param>
 /// <param name="dataIsEncrypt">数据是否加密</param>
 public Global(string dataAssemblyName = "", bool dataIsEncrypt = false)
 {
     //数据初始化
     Static.Start(dataAssemblyName, dataIsEncrypt);
 }