示例#1
0
        public static IInsertBuilder Column(this IInsertBuilder builder, bool condition, Func <SqlBuilderParameter> func)
        {
            builder = builder ?? throw new ArgumentNullException(nameof(builder));
            func    = func ?? throw new ArgumentNullException(nameof(func));

            if (condition)
            {
                return(builder.Column(func.Invoke()));
            }
            else
            {
                return(builder);
            }
        }
示例#2
0
        public static IInsertBuilder Column(this IInsertBuilder builder, string columnName, object value, DbType?dbType = null, ParameterDirection?direction = null, int?size = null)
        {
            builder = builder ?? throw new ArgumentNullException(nameof(builder));

            if (string.IsNullOrEmpty(columnName))
            {
                throw new ArgumentException($"{nameof(columnName)}不能为空", nameof(columnName));
            }
            //if (value == null)
            //    throw new ArgumentException($"{nameof(value)}不能为空", nameof(value));

            builder.Column(new SqlBuilderParameter(columnName, value, dbType, direction, size));

            return(builder);
        }
 public IInsertBuilder Column(string name, object value)
 {
     _builder.Column(name, value);
     return(this);
 }