当前位置: 首页>>代码示例>>C#>>正文


C# IQuery.IgnoreIdentifiersCase方法代码示例

本文整理汇总了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;
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:31,代码来源:ProcedureInfo.cs

示例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;
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:13,代码来源:Row.cs

示例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;
        }
开发者ID:ArsenShnurkov,项目名称:deveeldb,代码行数:41,代码来源:FunctionInfo.cs


注:本文中的IQuery.IgnoreIdentifiersCase方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。