本文整理汇总了C#中IQuery.IgnoreIdentifiersCase方法的典型用法代码示例。如果您正苦于以下问题:C# IQuery.IgnoreIdentifiersCase方法的具体用法?C# IQuery.IgnoreIdentifiersCase怎么用?C# IQuery.IgnoreIdentifiersCase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IQuery
的用法示例。
在下文中一共展示了IQuery.IgnoreIdentifiersCase方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MatchesInvoke
internal override bool MatchesInvoke(Invoke invoke, IQuery query)
{
if (invoke == null)
return false;
bool ignoreCase = true;
if (query != null)
ignoreCase = query.IgnoreIdentifiersCase();
if (!RoutineName.Equals(invoke.RoutineName, ignoreCase))
return false;
var inputParams = Parameters.Where(parameter => parameter.IsInput).ToList();
if (invoke.Arguments.Length != inputParams.Count)
return false;
for (int i = 0; i < invoke.Arguments.Length; i++) {
// TODO: support variable evaluation here? or evaluate parameters before reaching here?
if (!invoke.Arguments[i].IsConstant())
return false;
var argType = invoke.Arguments[i].ReturnType(query, null);
var paramType = Parameters[i].Type;
// TODO: verify if this is assignable (castable) ...
if (!paramType.IsComparable(argType))
return false;
}
return true;
}
示例2: Evaluate
private DataObject Evaluate(SqlExpression expression, IQuery queryContext)
{
var ignoreCase = queryContext.IgnoreIdentifiersCase();
// Resolve any variables to the table_def for this expression.
expression = Table.TableInfo.ResolveColumns(ignoreCase, expression);
// Get the variable resolver and evaluate over this data.
IVariableResolver vresolver = VariableResolver;
var reduced = expression.Evaluate(queryContext, vresolver, null);
if (reduced.ExpressionType != SqlExpressionType.Constant)
throw new InvalidOperationException("The DEFAULT expression of the column cannot be reduced to a constant");
return ((SqlConstantExpression) reduced).Value;
}
示例3: MatchesInvoke
internal override bool MatchesInvoke(Invoke request, IQuery query)
{
if (request == null)
return false;
bool ignoreCase = true;
if (query != null)
ignoreCase = query.IgnoreIdentifiersCase();
if (!RoutineName.Equals(request.RoutineName, ignoreCase))
return false;
// TODO: add a better resolution to obtain the final type of the argument
// and compare it to the parameter type definition
bool unboundedSeen = false;
for (int i = 0; i < request.Arguments.Length; i++) {
var argType = request.Arguments[i].ReturnType(query, null);
if (i + 1 > Parameters.Length) {
if (!unboundedSeen)
return false;
// TODO: verify the type of the argument (how to evaluate?)
} else {
var param = Parameters[i];
unboundedSeen = param.IsUnbounded;
var paramType = param.Type;
if (!paramType.IsComparable(argType))
return false;
}
}
if (!unboundedSeen &&
request.Arguments.Length != Parameters.Length)
return false;
return true;
}