当前位置: 首页>>代码示例>>C#>>正文


C# Clauses.OrderByClause类代码示例

本文整理汇总了C#中Remotion.Linq.Clauses.OrderByClause的典型用法代码示例。如果您正苦于以下问题:C# OrderByClause类的具体用法?C# OrderByClause怎么用?C# OrderByClause使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OrderByClause类属于Remotion.Linq.Clauses命名空间,在下文中一共展示了OrderByClause类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VisitOrderByClause

        public virtual void VisitOrderByClause(OrderByClause orderByClause, QueryModel queryModel, int index)
        {
            ArgumentUtility.CheckNotNull ("orderByClause", orderByClause);
              ArgumentUtility.CheckNotNull ("queryModel", queryModel);

              VisitOrderings (orderByClause.Orderings, queryModel, orderByClause);
        }
开发者ID:nicocrm,项目名称:DotNetSDataClient,代码行数:7,代码来源:QueryModelVisitorBase.cs

示例2: VisitOrderByClause

 public override void VisitOrderByClause(OrderByClause orderByClause, QueryModel queryModel, int index)
 {
     foreach (var ordering in orderByClause.Orderings)
     {
         model.AddSort(ordering.Expression, ordering.OrderingDirection);
     }
 }
开发者ID:dpvreony-forks,项目名称:Lucene.Net.Linq,代码行数:7,代码来源:QueryModelTranslator.cs

示例3: Accept

    /// <summary>
    /// Accepts the specified visitor by calling its <see cref="IQueryModelVisitor.VisitOrdering"/> method.
    /// </summary>
    /// <param name="visitor">The visitor to accept.</param>
    /// <param name="queryModel">The query model in whose context this clause is visited.</param>
    /// <param name="orderByClause">The <see cref="OrderByClause"/> in whose context this item is visited.</param>
    /// <param name="index">The index of this item in the <paramref name="orderByClause"/>'s <see cref="OrderByClause.Orderings"/> collection.</param>
    public virtual void Accept (IQueryModelVisitor visitor, QueryModel queryModel, OrderByClause orderByClause, int index)
    {
      ArgumentUtility.CheckNotNull ("visitor", visitor);
      ArgumentUtility.CheckNotNull ("queryModel", queryModel);
      ArgumentUtility.CheckNotNull ("orderByClause", orderByClause);

      visitor.VisitOrdering (this, queryModel, orderByClause, index);
    }
开发者ID:GTuritto,项目名称:BrightstarDB,代码行数:15,代码来源:Ordering.cs

示例4: ApplyNodeSpecificSemantics

    protected override void ApplyNodeSpecificSemantics (QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
    {
      ArgumentUtility.CheckNotNull ("queryModel", queryModel);

      var clause = new OrderByClause();
      clause.Orderings.Add (new Ordering (GetResolvedKeySelector (clauseGenerationContext), OrderingDirection.Desc));
      queryModel.BodyClauses.Add (clause);
    }
开发者ID:natemcmaster,项目名称:Relinq,代码行数:8,代码来源:OrderByDescendingExpressionNode.cs

示例5: VisitOrderByClause

 public override void VisitOrderByClause(OrderByClause orderByClause, QueryModel queryModel, int index)
 {
     var joinDetector = new SelectAndOrderByJoinDetector(_nameGenerator, this, _joins, _expressionMap);
     foreach (Ordering ordering in orderByClause.Orderings)
     {
         joinDetector.VisitExpression(ordering.Expression);
     }
 }
开发者ID:Ruhollah,项目名称:nhibernate-core,代码行数:8,代码来源:AddJoinsReWriter.cs

示例6: VisitOrderByClause

        public override void VisitOrderByClause(OrderByClause orderByClause, QueryModel queryModel, int index)
        {
            var visitor = new EnigmaExpressionTreeVisitor(_objectExpression);
            foreach (var ordering in orderByClause.Orderings) {
                visitor.VisitExpression(ordering.Expression);
                _objectExpression.OrderBy(ordering.OrderingDirection);
            }

            base.VisitOrderByClause(orderByClause, queryModel, index);
        }
开发者ID:jaygumji,项目名称:EnigmaDb,代码行数:10,代码来源:EnigmaQueryModelVisitor.cs

示例7: ConvertsToSort_Desc

        public void ConvertsToSort_Desc()
        {
            var orderByClause = new OrderByClause();
            orderByClause.Orderings.Add(new Ordering(new LuceneQueryFieldExpression(typeof(string), "Name"), OrderingDirection.Desc));
            ExpectSortOnProperty("Name", SortField.STRING, OrderingDirection.Desc);

            transformer.VisitOrderByClause(orderByClause, queryModel, 0);

            Assert.That(transformer.Model.Sort.GetSort().Length, Is.EqualTo(1));
            AssertSortFieldEquals(transformer.Model.Sort.GetSort()[0], "Name", OrderingDirection.Desc, SortField.STRING);
        }
开发者ID:Zaixu,项目名称:Lucene.Net.Linq,代码行数:11,代码来源:QueryModelTranslatorTests.cs

示例8: ConvertsDateTimeOffsetToSort

        public void ConvertsDateTimeOffsetToSort()
        {
            var orderByClause = new OrderByClause();
            orderByClause.Orderings.Add(new Ordering(new LuceneQueryFieldExpression(typeof(DateTimeOffset?), "Date"), OrderingDirection.Asc));
            ExpectSortOnProperty("Date", SortField.LONG, OrderingDirection.Asc);

            transformer.VisitOrderByClause(orderByClause, queryModel, 0);

            Assert.That(transformer.Model.Sort.GetSort().Length, Is.EqualTo(1));
            AssertSortFieldEquals(transformer.Model.Sort.GetSort()[0], "Date", OrderingDirection.Asc, SortField.LONG);
        }
开发者ID:Zaixu,项目名称:Lucene.Net.Linq,代码行数:11,代码来源:QueryModelTranslatorTests.cs

示例9: Apply

    public void Apply ()
    {
      var clause = new OrderByClause ();
      QueryModel.BodyClauses.Add (clause);

      var result = _node.Apply (QueryModel, ClauseGenerationContext);
      Assert.That (result, Is.SameAs (QueryModel));

      Assert.That (clause.Orderings.Count, Is.EqualTo (1));
      Assert.That (clause.Orderings[0].OrderingDirection, Is.EqualTo (OrderingDirection.Asc));
      Assert.That (clause.Orderings[0].Expression, Is.SameAs (_node.GetResolvedKeySelector (ClauseGenerationContext)));
    }
开发者ID:natemcmaster,项目名称:Relinq,代码行数:12,代码来源:ThenByExpressionNodeTest.cs

示例10: ConvertsDateTimeToSortNonNumeric

        public void ConvertsDateTimeToSortNonNumeric()
        {
            var orderByClause = new OrderByClause();
            orderByClause.Orderings.Add(new Ordering(new LuceneQueryFieldExpression(typeof(DateTimeOffset?), "Date"), OrderingDirection.Asc));
            mappingInfo.Expect(m => m.GetMappingInfo("Date")).Return(nonNumericMappingInfo);
            nonNumericMappingInfo.Stub(i => i.FieldName).Return("Date");

            transformer.VisitOrderByClause(orderByClause, queryModel, 0);

            Assert.That(transformer.Model.Sort.GetSort().Length, Is.EqualTo(1));
            AssertSortFieldEquals(transformer.Model.Sort.GetSort()[0], "Date", OrderingDirection.Asc, SortField.STRING);
        }
开发者ID:benjaminramey,项目名称:Lucene.Net.Linq,代码行数:12,代码来源:QueryModelTranslatorTests.cs

示例11: VisitOrderByClause

        public override void VisitOrderByClause(OrderByClause orderByClause, QueryModel queryModel, int index)
        {
            Log.Trace(m => m("Original QueryModel:     {0}", queryModel));

            foreach (var visitor in orderingVisitors)
            {
                orderByClause.TransformExpressions(visitor.VisitExpression);
                Log.Trace(m => m("Transformed QueryModel after {0}: {1}", visitor.GetType().Name, queryModel));
            }
            
            ExpandCompositeOrderings(orderByClause);

            base.VisitOrderByClause(orderByClause, queryModel, index);
        }
开发者ID:TheHunter,项目名称:Lucene.Net.Linq,代码行数:14,代码来源:QueryModelTransformer.cs

示例12: VisitOrderByClause

        /// <summary>
        /// 解析 orderby 语句
        /// </summary>
        /// <param name="orderByClause"></param>
        /// <param name="queryModel"></param>
        /// <param name="index"></param>
        public override void VisitOrderByClause( OrderByClause orderByClause, QueryModel queryModel, int index )
        {
            foreach( var ordering in orderByClause.Orderings )
            {
                MySqlOrderByClauseVisitor visitor = new MySqlOrderByClauseVisitor( this.parameterAggregator );

                string orderByParts = visitor.Translate( ordering.Expression );

                string direction = ordering.OrderingDirection == OrderingDirection.Desc ? "DESC" : "ASC";

                queryPartsAggregator.OrderByParts.Add( string.Format( "{0} {1}", orderByParts, direction ) );
            }

            base.VisitOrderByClause( orderByClause, queryModel, index );
        }
开发者ID:huzhengxiao,项目名称:Restful,代码行数:21,代码来源:MySqlQueryModelVisitor.cs

示例13: SetUp

    public void SetUp ()
    {
      _generator = new UniqueIdentifierGenerator();
      _context = SqlStatementModelObjectMother.CreateSqlPreparationContext();
      _defaultStage = new DefaultSqlPreparationStage (
          CompoundMethodCallTransformerProvider.CreateDefault(), ResultOperatorHandlerRegistry.CreateDefault(), _generator);

      _mainFromClause = ExpressionHelper.CreateMainFromClause<Cook>();
      _selectClause = ExpressionHelper.CreateSelectClause (_mainFromClause);
      _orderByClause = ExpressionHelper.CreateOrderByClause();
      _queryModel = new QueryModel (_mainFromClause, _selectClause);

      _stageMock = MockRepository.GenerateStrictMock<ISqlPreparationStage>();
      _visitor = new TestableSqlPreparationQueryModelVisitor (_context, _stageMock);
      _visitorPartialMock = MockRepository.GeneratePartialMock<TestableSqlPreparationQueryModelVisitor> (_context, _stageMock);
    }
开发者ID:re-motion,项目名称:Relinq-SqlBackend,代码行数:16,代码来源:SqlPreparationQueryModelVisitorTest.cs

示例14: VisitOrderByClause

        /// <summary>
        /// 解析 orderby 语句
        /// </summary>
        /// <param name="orderByClause"></param>
        /// <param name="queryModel"></param>
        /// <param name="index"></param>
        public override void VisitOrderByClause( OrderByClause orderByClause, QueryModel queryModel, int index )
        {
            foreach( var ordering in orderByClause.Orderings )
            {
                OracleOrderByPartsCommandBuilder orderBuilder = new OracleOrderByPartsCommandBuilder();

                OracleOrderByClauseVisitor visitor = new OracleOrderByClauseVisitor();

                visitor.Translate( ordering.Expression, orderBuilder );

                string direction = ordering.OrderingDirection == OrderingDirection.Desc ? "desc" : "asc";

                commandBuilder.OrderByParts.Add( string.Format( "{0} {1}", orderBuilder.ToString(), direction ) );
            }

            base.VisitOrderByClause( orderByClause, queryModel, index );
        }
开发者ID:RushPm,项目名称:Restful,代码行数:23,代码来源:OracleQueryModelVisitor.cs

示例15: SetUp

    public void SetUp ()
    {
      _mockRepository = new MockRepository();
      _visitorMock = _mockRepository.StrictMock<TestQueryModelVisitor>();

      _bodyClauseMock1 = _mockRepository.StrictMock<IBodyClause>();
      _bodyClauseMock2 = _mockRepository.StrictMock<IBodyClause>();

      _ordering1 = new Ordering (ExpressionHelper.CreateExpression(), OrderingDirection.Asc);
      _ordering2 = new Ordering (ExpressionHelper.CreateExpression(), OrderingDirection.Asc);

      _resultOperator1 = new TestResultOperator();
      _resultOperator2 = new TestResultOperator();

      _queryModel = ExpressionHelper.CreateQueryModel<Cook>();
      _orderByClause = ExpressionHelper.CreateOrderByClause();
      _groupJoinClause = ExpressionHelper.CreateGroupJoinClause<Cook>();
    }
开发者ID:natemcmaster,项目名称:Relinq,代码行数:18,代码来源:QueryModelVisitorBaseTest.cs


注:本文中的Remotion.Linq.Clauses.OrderByClause类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。