Esempio n. 1
0
        /// <summary>
        /// 设置跳过行数
        /// </summary>
        /// <param name="count">跳过的行数</param>
        public ISqlBuilder Skip(int count)
        {
            var param = GetOffsetParam();

            ParameterManager.Add(param, count);
            return(this);
        }
Esempio n. 2
0
        /// <summary>
        /// 设置获取行数
        /// </summary>
        /// <param name="count">获取的行数</param>
        public ISqlBuilder Take(int count)
        {
            var param = GetLimitParam();

            ParameterManager.Add(param, count);
            Pager.PageSize = count;
            return(this);
        }
Esempio n. 3
0
 /// <summary>
 /// 获取跳过行数的参数名
 /// </summary>
 protected string GetOffsetParam()
 {
     if (string.IsNullOrWhiteSpace(OffsetParam) == false)
     {
         return(OffsetParam);
     }
     OffsetParam = ParameterManager.GenerateName();
     ParameterManager.Add(OffsetParam, 0);
     return(OffsetParam);
 }
Esempio n. 4
0
 /// <summary>
 /// 添加参数
 /// </summary>
 /// <param name="name">参数名</param>
 /// <param name="value">参数值</param>
 public ISqlBuilder AddParam(string name, object value)
 {
     ParameterManager.Add(name, value);
     return(this);
 }