/// <summary> /// Adds a <see cref="TypedValue"/> based on the <c>value</c> /// and <c>type</c> parameters to the <see cref="IList"/> in the /// <c>list</c> parameter. /// </summary> /// <param name="value">The value of the Property.</param> /// <param name="type">The <see cref="IType"/> of the Property.</param> /// <param name="list">The <see cref="IList"/> to add the <see cref="TypedValue"/> to.</param> /// <remarks> /// This method will add <see cref="TypedValue"/> objects to the <c>list</c> parameter. /// </remarks> protected void AddPropertyTypedValue(object value, IType type, IList list) { // TODO: I don't like this at all - why don't we have it return a TypedValue[] // or an ICollection that can be added to the list instead of modifying the // parameter passed in. if (value != null) { var stringValue = value as string; if (stringValue != null) { if (_isIgnoreCaseEnabled) { stringValue = stringValue.ToLower(); } if (_isLikeEnabled) { stringValue = _matchMode.ToMatchString(stringValue); } value = stringValue; } list.Add(new TypedValue(type, value)); } }
public InsensitiveLikeExpression(string propertyName, string value, MatchMode matchMode) : this(propertyName, matchMode.ToMatchString(value)) { }
/// <summary> /// Initializes a new instance of the <see cref="InsensitiveLikeExpression"/> class. /// </summary> /// <param name="projection">The projection.</param> /// <param name="value">The value.</param> /// <param name="matchMode">The match mode.</param> public InsensitiveLikeExpression(IProjection projection, string value, MatchMode matchMode) { this.projection = projection; this.value = matchMode.ToMatchString(value); }
public LikeExpression(string propertyName, string value, MatchMode matchMode, char?escapeChar, bool ignoreCase) : this(propertyName, matchMode.ToMatchString(value), escapeChar, ignoreCase) { }
public LikeExpression(string propertyName, string value, MatchMode matchMode) : this(propertyName, matchMode.ToMatchString(value)) { }
public LikeExpression(IProjection projection, string value, MatchMode matchMode) { this.projection = projection; this.value = matchMode.ToMatchString(value); }
public LikeExpression(string propertyName, string value, MatchMode matchMode, char? escapeChar, bool ignoreCase) : this(propertyName, matchMode.ToMatchString(value), escapeChar, ignoreCase) { }
public LikeExpression(IProjection projection, string value, MatchMode matchMode) { this.projection = projection; this.value = matchMode.ToMatchString(value); typedValue = new TypedValue(NHibernateUtil.String, this.value, EntityMode.Poco); }
/// <summary> /// Apply a "like" constraint to the project /// </summary> /// <param name="projection">The projection.</param> /// <param name="value">The value for the Property.</param> /// <param name="matchMode">The match mode.</param> /// <returns>A <see cref="LikeExpression"/>.</returns> public static SimpleExpression Like(IProjection projection, string value, MatchMode matchMode) { return(new SimpleExpression(projection, matchMode.ToMatchString(value), " like ")); }
public static SimpleExpression Like(string propertyName, string value, MatchMode matchMode) { return(new SimpleExpression(propertyName, matchMode.ToMatchString(value), " like ")); }
public static AbstractCriterion Like(string propertyName, string template, MatchMode matchMode) { return new LikeExpression(propertyName, matchMode.ToMatchString(template).ToLocalizableLikeClause(), MatchMode.Exact, null, false); }
public LikeExpression(IProjection projection, string value, MatchMode matchMode) { this.projection = projection; this.value = matchMode.ToMatchString(value); typedValue = new TypedValue(NHibernateUtil.String, this.value, false); }