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


C# ISqlBuilder.Append方法代码示例

本文整理汇总了C#中ISqlBuilder.Append方法的典型用法代码示例。如果您正苦于以下问题:C# ISqlBuilder.Append方法的具体用法?C# ISqlBuilder.Append怎么用?C# ISqlBuilder.Append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISqlBuilder的用法示例。


在下文中一共展示了ISqlBuilder.Append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Render

 public virtual void Render(ISqlBuilder builder, params Expression[] args)
 {
     builder.Append(name);
     builder.Append("(");
     builder.VisitEnumerable(args);
     builder.Append(")");
 }
开发者ID:netcasewqs,项目名称:elinq,代码行数:7,代码来源:StandardFunctionView.cs

示例2: Render

        public void Render(ISqlBuilder builder, params Expression[] args)
        {
            var value = args[1];
            var constExp = args[2] as ConstantExpression;
            if (constExp != null)
            {
                value = FormatValue(value,
                    (bool)constExp.Value
                    , (bool)(args[3] as ConstantExpression).Value
                    , (bool)(args[4] as ConstantExpression).Value);
            }
            else
            {
                var nv = args[2] as NamedValueExpression;
                if (nv != null)
                {
                    constExp = nv.Value as ConstantExpression;
                    value = FormatValue(value,
                   (bool)constExp.Value
                   , (bool)((args[3] as NamedValueExpression).Value as  ConstantExpression).Value
                   , (bool)((args[4] as NamedValueExpression).Value as ConstantExpression).Value);
                }
            }

            builder.Append("(");
            builder.Visit(args[0]);
            builder.Append(" LIKE ");
            builder.Visit(value);
            builder.Append(")");
        }
开发者ID:netcasewqs,项目名称:elinq,代码行数:30,代码来源:LikeFunctionView.cs

示例3: Render

        public void Render(ISqlBuilder builder, params Expression[] args)
        {
            if (args.Length != 2 && args.Length != 3)
            {
                throw new ArgumentException(string.Format(Res.ArgumentCountError, "CASE", "", " 2 or 3 "));
            }

            var whens = (args[0] as ICollection<Expression>).ToArray();
            var thens = (args[1] as ICollection<Expression>).ToArray();
            var @else = args[2] as Expression;

            builder.Append("CASE");

            var lenght = whens.Length;
            for (int i = 0; i < lenght; i++)
            {
                builder.Append(" WHEN ");
                builder.Visit(whens[i]);
                builder.Append(" THEN ");
                builder.Visit(thens[i]);
            }

            if (@else != null)
            {
                builder.Append(" ELSE ");
                builder.Visit(@else);
            }

            builder.Append(" END");
        }
开发者ID:CMONO,项目名称:elinq,代码行数:30,代码来源:CaseFunctionView.cs

示例4: Render

 public virtual void Render(ISqlBuilder visitor, params Expression[] args)
 {
     var targetArg = args[0];
     visitor.Append("RTRIM(LTRIM(");
     visitor.Visit(targetArg);
     visitor.Append("))");
 }
开发者ID:jaykizhou,项目名称:elinq,代码行数:7,代码来源:LRTrimFunctionView.cs

示例5: Render

        public void Render(ISqlBuilder visitor, params Expression[] args)
        {
            var whens = (args[0] as ICollection<Expression>).ToArray();
            var thens = (args[1] as ICollection<Expression>).ToArray();
            var @else = args[2] as Expression;

            var lenght = whens.Length;
            for (int i = 0; i < lenght; i++)
            {
                if (i != 0)
                    visitor.Append(",");

                visitor.Append("IIF(");
                visitor.Visit(whens[i]);
                visitor.Append(",");
                visitor.Visit(thens[i]);

                if (i == lenght - 1)
                {
                    if (@else != null)
                    {
                        visitor.Append(",");
                        visitor.Visit(@else);
                    }
                    for (var j = i; j >= 0; j--)
                        visitor.Append(")");

                }

            }
        }
开发者ID:CMONO,项目名称:elinq,代码行数:31,代码来源:IFFunctionView.cs

示例6: Render

        public void Render(ISqlBuilder builder, params Expression[] args)
        {
            if (args != null && args.Length > 0)
                throw new ArgumentException(string.Format(Res.ArgumentCountError, Name, "no", ""));

            builder.Append(Name);
            builder.Append("()");
        }
开发者ID:netcasewqs,项目名称:elinq,代码行数:8,代码来源:NoArgFunctionView.cs

示例7: Render

 public void Render(ISqlBuilder builder, params Expression[] args)
 {
     if (args.Length == 1)
     {
         builder.Append("DATE_FORMAT(");
         builder.Visit(args[0]);
         builder.Append(",'%H:%i:%s')");
     }
 }
开发者ID:netcasewqs,项目名称:elinq,代码行数:9,代码来源:ToTimeFunctionView.cs

示例8: Render

 public void Render(ISqlBuilder builder, params Expression[] args)
 {
     builder.Append("CDate(");
     builder.Visit(args[0]);
     builder.Append(" & '/' & ");
     builder.Visit(args[1]);
     builder.Append(" & '/' & ");
     builder.Visit(args[2]);
     builder.Append(")");
 }
开发者ID:CMONO,项目名称:elinq,代码行数:10,代码来源:ToDate3FunctionView.cs

示例9: Render

 public void Render(ISqlBuilder builder, params Expression[] args)
 {
     //SUBSTRING(userName,1,2)+'ddd'+SUBSTRING(userName,3,LEN(userName))
     if (args.Length != 3)
     {
         throw new NotSupportedException(string.Format(Res.ArgumentCountError, "Insert", "", "3"));
     }
     //var secondStartIndex = Expression.Constant((int)(args[1] as ConstantExpression).Value + 1);
     builder.Append("(CASE WHEN ");
     builder.Visit(args[1]);
     builder.Append(" > LEN(");
     builder.Visit(args[0]);
     builder.Append(") THEN null ELSE (SUBSTRING(");
     builder.Visit(args[0]);
     builder.Append(",1,");
     builder.Visit(Expression.Subtract(Expression.Property(args[1], "Value"), Expression.Constant(1, Types.Int32)));
     builder.Append(") + ");
     builder.Visit(args[2]);
     builder.Append(" + SUBSTRING(");
     builder.Visit(args[0]);
     builder.Append(",");
     builder.Visit(args[1]);
     builder.Append(",LEN(");
     builder.Visit(args[0]);
     builder.Append("))) END)");
 }
开发者ID:netcasewqs,项目名称:elinq,代码行数:26,代码来源:InsertFunctionView.cs

示例10: Render

 public void Render(ISqlBuilder visitor, params Expression[] args)
 {
     if (args == null || (args.Length != 2 && args.Length != 3))
     {
         throw new NotSupportedException(string.Format(Res.ArgumentCountError, "remove()", "", " 2 or 3 "));
     }
     visitor.Append("IIF((LEN(");
     visitor.Visit(args[0]);
     visitor.Append(") < ");
     visitor.Visit(args[1]);
     visitor.Append("),NULL,REPLACE(");
     visitor.Visit(args[0]);
     visitor.Append(",MID(");
     visitor.Visit(args[0]);
     visitor.Append(",");
     visitor.Visit(args[1]);
     if (args.Length == 2)
     {
         visitor.Append(",8000)");
     }
     else
     {
         visitor.Append(",");
         visitor.Visit(args[2]);
         visitor.Append(")");
     }
     visitor.Append(",''))");
 }
开发者ID:jaykizhou,项目名称:elinq,代码行数:28,代码来源:RemoveFunctionView.cs

示例11: Render

        public void Render(ISqlBuilder builder, params Expression[] args)
        {
            var year = args[0];
            var month = args[1];

            builder.Append("(CASE");
            builder.Append(" WHEN ");
            builder.Visit(year);
            builder.Append("% 4 = 0 AND(");
            builder.Visit(year);
        }
开发者ID:netcasewqs,项目名称:elinq,代码行数:11,代码来源:DaysInMonthFunctionView.cs

示例12: Render

        public void Render(ISqlBuilder visitor, params Expression[] args)
        {
            if (args.Length != 2)
                throw new ArgumentException(string.Format(Res.ArgumentCountError, "dateadd", "", " 2 "));

            var addPart = (args[1] as ConstantExpression).Value;

            visitor.Append("(");
            visitor.Visit(args[0]);
            visitor.Append(" + interval '" + addPart.ToString() + "' " + Type.ToString() + ")");
        }
开发者ID:jaykizhou,项目名称:elinq,代码行数:11,代码来源:DateAddFunctionView.cs

示例13: Render

 public void Render(ISqlBuilder builder, params Expression[] args)
 {
     builder.Append("IIF(");
     builder.Visit(args[0]);
     builder.Append(" = ");
     builder.Visit(args[1]);
     builder.Append(", 0, IIF(");
     builder.Visit(args[0]);
     builder.Append(" < ");
     builder.Visit(args[1]);
     builder.Append(", -1, 1))");
 }
开发者ID:CMONO,项目名称:elinq,代码行数:12,代码来源:CompareFunctionView.cs

示例14: Render

 public void Render(ISqlBuilder ctx, params Expression[] args)
 {
     ctx.Append("DATETIME(");
     ctx.Visit(args[0]);
     ctx.Append(",'");
     //ctx.Append((args[0] as ConstantExpression).Value);
     ExecuteContext.Items.Add(SQLiteDateTimeFunctions.IgonreIntDoubleConvert, null);
     ctx.Visit(args[1]);
     ExecuteContext.Items.Remove(SQLiteDateTimeFunctions.IgonreIntDoubleConvert);
     ctx.Append(" ");
     ctx.Append(type);
     ctx.Append("')");
 }
开发者ID:CMONO,项目名称:elinq,代码行数:13,代码来源:AddDateTemplateFunctionView.cs

示例15: Render

 public void Render(ISqlBuilder builder, params Expression[] args)
 {
     if (args.Length != 2)
     {
         throw new NotSupportedException(string.Format(Res.ArgumentCountError, "Left", "", "2"));
     }
     builder.Append("LEFT(");
     builder.Visit(args[0]);
     builder.Append(",(INSTR(");
     builder.Visit(args[0]);
     builder.Append(",");
     builder.Visit(args[1]);
     builder.Append(")-1))");
 }
开发者ID:jaykizhou,项目名称:elinq,代码行数:14,代码来源:LeftFunctionView.cs


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