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/

  • 相关阅读:
    【重要】ASCII码表
    深入了解php opcode缓存原理
    php 请求参数限制
    【Demo】 生成二维码 和 条形码
    【Demo】HTML5 拍照上传
    jq cookie的使用
    vue.js中的v-for输出数组理解
    js无限轮播的写法
    HTML5视频的使用总结
    angular报错总计
  • 原文地址:https://www.cnblogs.com/Tonyyang/p/1746352.html
Copyright © 2011-2022 走看看