public override void VisitOrdering(Remotion.Linq.Clauses.Ordering ordering, QueryModel queryModel, Remotion.Linq.Clauses.OrderByClause orderByClause, int index)
 {
     _isInstanceQuery = false;
     var selector = SparqlGeneratorWhereExpressionTreeVisitor.GetSparqlExpression(ordering.Expression,
                                                                                  _queryBuilder);
     if (selector is SelectVariableNameExpression)
     {
         var selectorVar = selector as SelectVariableNameExpression;
         _queryBuilder.AddOrdering(new SparqlOrdering("?" + selectorVar.Name, ordering.OrderingDirection));
     }
     else
     {
         throw new NotSupportedException(
             String.Format("LINQ-to-SPARQL does not currently support ordering by the expression '{0}'", ordering.Expression));
     }
     base.VisitOrdering(ordering, queryModel, orderByClause, index);
 }
Exemplo n.º 2
0
 public override void VisitOrdering(Remotion.Linq.Clauses.Ordering ordering, QueryModel queryModel, Remotion.Linq.Clauses.OrderByClause orderByClause, int index)
 {
     _queryAsString.AppendFormat("orderby {0} {1}", ordering.Expression.ToString(), ordering.OrderingDirection == Remotion.Linq.Clauses.OrderingDirection.Asc ? "asc" : "desc");
 }
Exemplo n.º 3
0
        /// <summary>
        /// Deal with an order by, on a seperate line.
        /// </summary>
        /// <param name="ordering"></param>
        /// <param name="queryModel"></param>
        /// <param name="orderByClause"></param>
        /// <param name="index"></param>
        public override void VisitOrdering(Remotion.Linq.Clauses.Ordering ordering, QueryModel queryModel, Remotion.Linq.Clauses.OrderByClause orderByClause, int index)
        {
            var d = ordering.OrderingDirection == Remotion.Linq.Clauses.OrderingDirection.Asc ? "asc" : "desc";

            _queryAsString.AppendLine($"orderby {ExpressionStringConverter.Format(ordering.Expression)} {d}");
        }