Пример #1
0
        /// <summary>
        /// 创建插入SQL实参列表
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="hasPrimaryKey">是否包含主键</param>
        /// <returns></returns>
        public string InsertArgumentList(bool hasKey)
        {
            ColumnMetaCollection collection = this.CurrentTable.Columns;

            if (!hasKey)
            {
                collection = collection.GetNoKeyCollection();
            }
            return(collection.Concat((col) => { return "@" + col.ColumnName; }, ","));
        }
Пример #2
0
        /// <summary>
        /// 创建实参列表
        /// </summary>
        /// <param name="columns"></param>
        /// <param name="hasPrimaryKey">是否包含主键</param>
        /// <returns></returns>
        public string MethodArgumentList(string tableName, bool hasKey)
        {
            ColumnMetaCollection collection = this.CurrentTable.Columns;

            if (!hasKey)
            {
                collection = collection.GetNoKeyCollection();
            }
            return(collection.Concat((col) => { return tableName.ToLower() + "." + col.ColumnName; }, ","));
        }
Пример #3
0
        /// <summary>
        /// 创建形参列表
        /// </summary>
        /// <param name="columns">列</param>
        /// <param name="hasPrimaryKey">是否包含主键</param>
        /// <returns></returns>
        public string MethodParameterList(bool hasKey)
        {
            ColumnMetaCollection collection = this.CurrentTable.Columns;

            if (!hasKey)
            {
                collection = collection.GetNoKeyCollection();
            }


            return(collection.Concat((col) => { return col.FieldTypeName + " " + col.ColumnName.ToLower(); }, ","));
        }
Пример #4
0
        /// <summary>
        /// 创建DBparameter列表
        /// </summary>
        /// <param name="DbHelperInstanceName"></param>
        /// <param name="columns"></param>
        /// <param name="hasPrimaryKey"></param>
        /// <returns></returns>
        public string CreateDbParameterList(string DbHelperInstanceName, string varName, bool hasKey)
        {
            ColumnMetaCollection collection = this.CurrentTable.Columns;

            if (!hasKey)
            {
                collection = collection.GetNoKeyCollection();
            }


            return(collection.Concat((col) => { return CreateDbParameter(DbHelperInstanceName, varName, col); }, ",\r\n\t\t\t\t"));
        }