// common methods static void InitBuilder(ISelectBuilder builder, SqlConfig setting) { builder.SetSelect(setting.Select); builder.SetFrom(setting.From); var orderBy = setting.OrderBy.Default; string rowNumberOrderBy = orderBy; orderBy = ParseOrderBy(setting, orderBy.Trim(), ref rowNumberOrderBy); builder.AddOrderBy(string.Format(" {0} ", orderBy)); builder.AddRowNumberOrderBy(string.Format(" {0} ", rowNumberOrderBy)); var groupBy = setting.GroupBy.Default + ""; groupBy = ParseGroupBy(setting, groupBy.Trim()); builder.AddGroupBy(groupBy); builder.SetPageSize(setting.PageSize); builder.SetPageNumber(setting.PageNumber); }