示例#1
0
 /// <summary>
 /// 直接添加某个 Sql 查询条件。
 /// 如果没有相应的 And 连接符,则自动添加。
 /// </summary>
 /// <param name="query">The query.</param>
 /// <param name="formatSql">The format SQL.</param>
 /// <param name="parameters">The parameters.</param>
 /// <returns></returns>
 public static IPropertyQuery AddConstrainSql(this IPropertyQuery query, string formatSql, params object[] parameters)
 {
     if (query.HasWhere && query.IsCompleted)
     {
         query.And();
     }
     return(query.ConstrainSql(formatSql, parameters));
 }
示例#2
0
 /// <summary>
 /// 直接添加某个查询条件。
 /// 如果没有相应的 And 连接符,则自动添加。
 /// </summary>
 /// <param name="query">The query.</param>
 /// <param name="property">The property.</param>
 /// <param name="propertyOwner">The property owner.</param>
 /// <returns></returns>
 public static IPropertyQueryValue AddConstrain(this IPropertyQuery query, IManagedProperty property, Type propertyOwner = null)
 {
     if (query.HasWhere && query.IsCompleted)
     {
         query.And();
     }
     return(query.Constrain(property, propertyOwner));
 }