Beispiel #1
0
        public override string FormatExpressionByIn(string fieldName, params object[] values)
        {
            if (values.Length == 0)
            {
                throw new ArgumentException("values len:0");
            }

            var paramNames = new string[values.Length];

            for (int i = 0; i < paramNames.Length; i++)
            {
                var paramName = MySqlParamHelper.FormatParamName(fieldName + (i + 1));
                paramNames[i] = paramName;
                AddParam(MySqlParamHelper.MakeInParam(paramName, values[i]));
            }
            return(string.Format("{0} IN ({1})", MySqlParamHelper.FormatName(fieldName), string.Join(",", paramNames)));
        }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public override string FormatName(string name)
 {
     return(MySqlParamHelper.FormatName(name));
 }