internal NHibernateCriterionVisitor(ICriteria contentItemVersionRecordCriteria, FilterClause filterClause, IODataServiceMetadata metadata) : base(contentItemVersionRecordCriteria, metadata) { this.filterClause = filterClause; this.projectionVisitor = new NHibernateProjectionVisitor(contentItemVersionRecordCriteria, filterClause, metadata); this.criterionMethodVisitorFactory = new Dictionary <string, Func <IEnumerable <QueryNode>, ICriterion> >() { { "substring", this.SubStringOfMethod }, { "startswith", this.StartsWithMethod }, { "endswith", this.EndsWithMethod }, }; }
internal static ICriteria OrderContentQuery(this ICriteria criteria, OrderByClause orderByClause, IODataServiceMetadata metadata) { if (null == orderByClause) { return(criteria); } var projectionVisitor = new NHibernateProjectionVisitor(criteria, orderByClause, metadata); var projection = projectionVisitor.Visit(orderByClause.Expression); if (null != projection && orderByClause.Direction == OrderByDirection.Ascending) { criteria.AddOrder(Order.Asc(projection)); } if (null != projection && orderByClause.Direction == OrderByDirection.Descending) { criteria.AddOrder(Order.Desc(projection)); } return(criteria.OrderContentQuery(orderByClause.ThenBy, metadata)); }