本文整理汇总了C#中Field.Any方法的典型用法代码示例。如果您正苦于以下问题:C# Field.Any方法的具体用法?C# Field.Any怎么用?C# Field.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Field
的用法示例。
在下文中一共展示了Field.Any方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EvaluateBinary
private Field EvaluateBinary(Field left, SqlExpressionType binaryType, Field right, bool isAll, bool isAny)
{
if (isAny)
return left.Any(binaryType, right, context);
if (isAll)
return left.All(binaryType, right, context);
switch (binaryType) {
case SqlExpressionType.Add:
return left.Add(right);
case SqlExpressionType.Subtract:
return left.Subtract(right);
case SqlExpressionType.Multiply:
return left.Multiply(right);
case SqlExpressionType.Divide:
return left.Divide(right);
case SqlExpressionType.Modulo:
return left.Modulus(right);
case SqlExpressionType.GreaterThan:
return left.IsGreaterThan(right);
case SqlExpressionType.GreaterOrEqualThan:
return left.IsGreterOrEqualThan(right);
case SqlExpressionType.SmallerThan:
return left.IsSmallerThan(right);
case SqlExpressionType.SmallerOrEqualThan:
return left.IsSmallerOrEqualThan(right);
case SqlExpressionType.Equal:
return left.IsEqualTo(right);
case SqlExpressionType.NotEqual:
return left.IsNotEqualTo(right);
case SqlExpressionType.Is:
return left.Is(right);
case SqlExpressionType.IsNot:
return left.IsNot(right);
case SqlExpressionType.Like:
return left.IsLike(right);
case SqlExpressionType.NotLike:
return left.IsNotLike(right);
case SqlExpressionType.And:
return left.And(right);
case SqlExpressionType.Or:
return left.Or(right);
case SqlExpressionType.XOr:
return left.XOr(right);
// TODO: ANY and ALL
default:
throw new ExpressionEvaluateException(String.Format("The type {0} is not a binary expression or is not supported.", binaryType));
}
}
示例2: ParseField
protected virtual String ParseField(Field field) {
List<String> parsed = new List<String>();
if (field.Any(attribute => attribute is Distinct)) {
parsed.Add("DISTINCT");
}
Collection collection = field.FirstOrDefault(statement => statement is Collection) as Collection;
parsed.Add(collection == null ? String.Format("`{0}`", field.Name) : String.Format("`{0}`.`{1}`", collection.Name, field.Name));
if (field.Any(attribute => attribute is FieldType)) {
parsed.Add(this.ParseType(field.First(attribute => attribute is FieldType) as FieldType));
}
return String.Join(" ", parsed);
}