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/

  • 相关阅读:
    剑指 Offer 25. 合并两个排序的链表
    53. 最大子序和 动态规划
    121. 买卖股票的最佳时机
    20. 有效的括号
    centos7 常用操作
    树莓派
    golang 学习笔记
    并发 线程 进程
    连接内网问题
    Lamp 高并发优化
  • 原文地址:https://www.cnblogs.com/Tonyyang/p/1746352.html
Copyright © 2011-2022 走看看