Пример #1
0
        /// <summary>
        /// 生成指定加载选项的聚合SQL。
        /// </summary>
        /// <param name="loadOptions">The load options.</param>
        /// <param name="whereCondition">简单的过滤条件,如:
        /// PBS.PBSTypeId = '...'</param>
        /// <param name="joinCondition">The join condition.</param>
        /// <returns></returns>
        public string GenerateQuerySQL(LoadOptionSelector loadOptions, string whereCondition = null, string joinCondition = null)
        {
            var aggregateSQL = new AggregateSQLGenerator(loadOptions.InnerDescriptor, whereCondition, joinCondition);
            var result       = aggregateSQL.Generate();

            return(result);
        }
Пример #2
0
        /// <summary>
        /// 生成指定加载选项的聚合SQL。
        ///
        /// 此方法使用父对象的Id作为查询条件。
        /// </summary>
        /// <param name="loadOptions"></param>
        /// <param name="parentId"></param>
        /// <returns></returns>
        public string GenerateQuerySQL(LoadOptionSelector loadOptions, object parentId)
        {
            var aggregateSQL = new AggregateSQLGenerator(loadOptions.InnerDescriptor, null);
            var result       = aggregateSQL.Generate();

            result = string.Format(result, parentId);
            return(result);
        }