本文整理汇总了C#中ICriteriaQuery.GetTypedValue方法的典型用法代码示例。如果您正苦于以下问题:C# ICriteriaQuery.GetTypedValue方法的具体用法?C# ICriteriaQuery.GetTypedValue怎么用?C# ICriteriaQuery.GetTypedValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICriteriaQuery
的用法示例。
在下文中一共展示了ICriteriaQuery.GetTypedValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetTypedValues
public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
{
return new TypedValue[]
{
criteriaQuery.GetTypedValue(criteria, _propertyName, _value.ToString().ToLower())
};
}
示例2: GetTypedValues
/// <summary>
/// Return typed values for all parameters in the rendered SQL fragment
/// </summary>
/// <param name="criteria"></param>
/// <param name="criteriaQuery"></param>
/// <returns>
/// An array of TypedValues for the Expression.
/// </returns>
public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
{
if (this.anotherGeometry is IGeometry)
{
return new TypedValue[] { criteriaQuery.GetTypedValue(criteria, propertyName, anotherGeometry) };
}
return new TypedValue[0];
}
示例3: GetTypedValues
public static TypedValue[] GetTypedValues(ICriteriaQuery criteriaQuery, ICriteria criteria,
IProjection projection,
string propertyName,
params object[] values)
{
List<TypedValue> types = new List<TypedValue>();
if (projection == null)
{
foreach (object value in values)
{
TypedValue typedValue = criteriaQuery.GetTypedValue(criteria, propertyName, value);
types.Add(typedValue);
}
}
else
{
TypedValue[] typedValues = projection.GetTypedValues(criteria, criteriaQuery);
types.AddRange(typedValues);
// we add the values collection _twice_ on purpose.
// once is for the projection types, if they exists
// the second for the parameters of the expression itself
// if the projection is using no types, we will try to guess
// what we have here
foreach (object value in values)
{
if (typedValues.Length != 0)
{
types.AddRange(typedValues);
}
else
{
types.Add(new TypedValue(NHibernateUtil.GuessType((object)value), value, EntityMode.Poco));
}
}
}
return types.ToArray();
}
示例4: GetTypedValues
/// <summary>
/// Return typed values for all parameters in the rendered SQL fragment
/// </summary>
/// <param name="criteria"></param>
/// <param name="criteriaQuery"></param>
/// <returns>
/// An array of TypedValues for the Expression.
/// </returns>
public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
{
return new TypedValue[] { criteriaQuery.GetTypedValue(criteria, this.propertyName, this.envelope ) };
}
示例5: GetTypedValues
public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
{
List<TypedValue> typedValues = new List<TypedValue>();
if (projection != null)
{
typedValues.AddRange(projection.GetTypedValues(criteria, criteriaQuery));
typedValues.AddRange(CriterionUtil.GetTypedValues(criteriaQuery, criteria, projection, null, value.ToString().ToLower()));
}
else
typedValues.Add(criteriaQuery.GetTypedValue(criteria, propertyName, value.ToString().ToLower()));
return typedValues.ToArray();
}
示例6: GetParameterTypedValue
public TypedValue GetParameterTypedValue(ICriteria criteria, ICriteriaQuery criteriaQuery)
{
var matchValue = value.ToString().ToLower();
if (projection != null)
{
return CriterionUtil.GetTypedValues(criteriaQuery, criteria, projection, null, matchValue).Single();
}
return criteriaQuery.GetTypedValue(criteria, propertyName, matchValue);
}
示例7: GetTypedValues
public static TypedValue[] GetTypedValues(ICriteriaQuery criteriaQuery, ICriteria criteria,
IProjection projection,
string propertyName,
params object[] values)
{
List<TypedValue> types = new List<TypedValue>();
var propertyProjection = projection as IPropertyProjection;
if (projection == null || propertyProjection != null)
{
var pn = propertyProjection != null ? propertyProjection.PropertyName : propertyName;
foreach (object value in values)
{
TypedValue typedValue = criteriaQuery.GetTypedValue(criteria, pn, value);
types.Add(typedValue);
}
}
else
{
foreach (object value in values)
{
types.Add(new TypedValue(NHibernateUtil.GuessType((object)value), value, EntityMode.Poco));
}
}
return types.ToArray();
}
示例8: GetTypedValues
public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
{
object icvalue = _ignoreCase ? _value.ToString().ToLower() : _value;
return new TypedValue[]
{
criteriaQuery.GetTypedValue(criteria, _propertyName, icvalue)
};
}
示例9: GetParameterTypedValue
public TypedValue GetParameterTypedValue(ICriteria criteria, ICriteriaQuery criteriaQuery)
{
object icvalue = ignoreCase ? value.ToString().ToLower() : value;
if (_projection != null)
{
return CriterionUtil.GetTypedValues(criteriaQuery, criteria, _projection, null, icvalue).Single();
}
return criteriaQuery.GetTypedValue(criteria, propertyName, icvalue);
}
示例10: GetTypedValues
public override TypedValue[] GetTypedValues(ICriteria criteria, ICriteriaQuery criteriaQuery)
{
return new TypedValue[] {criteriaQuery.GetTypedValue(criteria, propertyName, ignoreCase ? value.ToLower() : value)};
}