F/ADO/Par.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System
{
    /// <summary>
    /// 参数化
    /// </summary>
    public static class Par
    {
        /// <summary>
        /// 让SQL 参数化
        /// </summary>
        /// <param name="sql">SQL语句,{0},{1},{2}</param>
        /// <param name="cs">逐一对应替换</param>
        /// <returns></returns>
        public static F.ADO.Model.Par FPar(this string sql, params object[] cs)
        {
            F.ADO.Model.Par mm = new F.ADO.Model.Par();
            FHash fh = new FHash();
            for (int i = 0; i < cs.Length; i++)
            {
                string types = cs[i].GetType().ToString();
                if (types == "System.Int32[]")
                {
                    sql = 处理参数1(((int[])cs[i]).ToList(), i, sql);
                    //sql = 处理参数(((int[])cs[i]).ToList(), i, sql, fh);
                }
                else if (types == "System.String[]")
                {
                    sql = 处理参数1(((string[])cs[i]).ToList(), i, sql);
                    //sql = 处理参数(((string[])cs[i]).ToList(), i, sql, fh);
                }
                else if (types == "System.Collections.Generic.List`1[System.Int32]")
                {
                    sql = 处理参数1((List<int>)cs[i], i, sql);
                    //sql = 处理参数((List<int>)cs[i], i, sql, fh);
                }
                else if (types == "System.Collections.Generic.List`1[System.String]")
                {
                    sql = 处理参数1((List<string>)cs[i], i, sql);
                    //sql = 处理参数((List<string>)cs[i], i, sql, fh);
                }
                else if (types == "System.FList`1[System.Int32]")
                {
                    sql = 处理参数1(((FList<int>)cs[i]).ToList(), i, sql);
                    //sql = 处理参数(((FList<int>)cs[i]).ToList(), i, sql, fh);
                }
                else if (types == "System.FList`1[System.String]")
                {
                    sql = 处理参数1(((FList<string>)cs[i]).ToList(), i, sql);
                    //sql = 处理参数(((FList<string>)cs[i]).ToList(), i, sql, fh);
                }
                else
                {
                    string q = "@f" + i;
                    sql = sql.Replace("{" + i + "}", q);
                    fh.Add(q, cs[i]);
后面还有 61 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。