Esempio n. 1
0
 /// <summary>
 /// 针对IUpdate的查询模型
 /// 会受到 PropertiesCache<TEntity>.BlockWhereFields 的影响
 /// </summary>
 /// <typeparam name="TEntity"></typeparam>
 /// <typeparam name="TQueryModel"></typeparam>
 /// <param name="update">操作句柄</param>
 /// <param name="queryModel">查询模型</param>
 /// <returns></returns>
 public static IUpdate <TEntity> WhereWithModel <TEntity, TQueryModel>(this IUpdate <TEntity> update, TQueryModel queryModel) where TEntity : class where TQueryModel : QueryModel, new()
 {
     if (queryModel.Fuzzy != null && queryModel.Fuzzy.Length != 0)
     {
         return(update.Where(GetFuzzyExpression <TEntity, TQueryModel>(queryModel)));
     }
     return(update);
 }
Esempio n. 2
0
 public static IUpdate <TEntity> WhereWithEntity <TEntity>(this IUpdate <TEntity> update, IEnumerable <string> collection, TEntity entity) where TEntity : class
 {
     return(update.Where(GetWhereExpression(collection, entity)));
 }