zoukankan      html  css  js  c++  java
  • Evaluate用法

    1.语法

    public object Evaluate( 
       Type objectType,  
       CriteriaOperator expression,  
       CriteriaOperator criteria 
    );

    Parameters

    objectType

            A System.Type object that identifies the type of objects against which the expression will be evaluated.

    expression
    A DevExpress.Data.Filtering.CriteriaOperator object that specifies the expression to evaluate.
    criteria
    A DevExpress.Data.Filtering.CriteriaOperator object that specifies the filter criteria. The objects that match this criteria will be used to evaluate the expression.

    Return Value

    The value evaluated.

    2.用法

          <1>
          

    代码
    using DevExpress.Xpo;
    using DevExpress.Data.Filtering;

    // A custom XPobject
    class Person : XPObject {
       
    //...
       bool isMale;
       
    public bool IsMale {
          
    get { return isMale; }
          
    set { isMale = value; }
       }      
    }

    // Calculate the number of objects.
    object count = Session.DefaultSession.Evaluate(typeof(Person), CriteriaOperator.Parse("Count()"), 
        CriteriaOperator.Parse(
    "IsMale = true"))

        <2>

        

    代码
    using DevExpress.Data.Filtering;

    //...

    decimal sumPaid = (decimal)session.Evaluate<Order>(CriteriaOperator.Parse("Sum(OrderTotals)"), 
        
    new BinaryOperator("OrderDate", DateTime.Today.AddDays(-10), BinaryOperatorType.Greater));

    欢迎转载,转载请注明出处:http://www.cnblogs.com/Tonyyang/

  • 相关阅读:
    用导数解决逗逼初三数学二次函数图像题
    NOIP 2014 pj & tg
    BZOJ 1004
    双参数Bellman-ford带队列优化类似于背包问题的递推
    emu1
    無題
    15 day 1代碼
    javascript quine
    线段树的总结
    Watering the Fields(irrigation)
  • 原文地址:https://www.cnblogs.com/Tonyyang/p/1746352.html
Copyright © 2011-2022 走看看