Пример #1
0
 public override SqlString ToGroupSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery)
 {
     if (!grouped)
     {
         throw new InvalidOperationException("not a grouping projection");
     }
     return(new SqlString(StringHelper.Join(",", criteriaQuery.GetColumns(criteria, propertyName))));
 }
Пример #2
0
		public override SqlString ToGroupSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary<string, IFilter> enabledFilters)
		{
			if (!grouped)
			{
				throw new InvalidOperationException("not a grouping projection");
			}
			return new SqlString(StringHelper.Join(",", criteriaQuery.GetColumns(criteria, propertyName)));
		}
Пример #3
0
        public virtual SqlString ToGroupSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery)
        {
            if (projection is IPropertyProjection propertyProjection)
            {
                return(new SqlString(string.Join(", ", criteriaQuery.GetColumns(criteria, propertyProjection.PropertyName))));
            }

            //This is kind of a hack. The hack is based on the fact that ToGroupSqlString always called after ToSqlString.
            return(SqlStringHelper.RemoveAsAliasesFromSql(renderedProjection));
        }
        protected override SqlString ToLeftSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery)
        {
            var columns = criteriaQuery.GetColumns(criteria, propertyName);

            if (columns.Length <= 1)
            {
                return(new SqlString(columns));
            }
            return(new SqlString("(", string.Join(", ", columns), ")"));
        }