Show / Hide Table of Contents

    IDataStore.Evaluate<TValue>(string expression, int row) Method

    .NET Standard 2.x

    Calculates the specified DataWindow expression using the specified row (by the index number) in the primary buffer of the DataStore.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      public TValue Evaluate<TValue>(string expression, int row);
    

    Type Parameters

    TValue

    The type of the result value.

    Parameters

    expression System.String

    A DataWindow expression to evaluate.

    row System.Int32

    Returns

    TValue

    The result value.

    Examples

    The following code example demonstrates how to use the Evaluate<TValue>(String, Int32) method.

    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class EvaluateExample
        {
            private readonly SchoolContext _context;
    
            public EvaluateExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example2()
            {
                // Instantiates a DataStore object with dataobject: d_department
                var datastore = new DataStore("d_department", _context);
    
                datastore.Retrieve();
    
                // This datastore has 4 records
                // Values of the first record is:
                // Name: Engineering; Budget: 350000.00
    
                string nameAndBudget = datastore.Evaluate<string>("name +': ' + budget)", 0);
    
                Console.WriteLine(nameAndBudget);
    
                /*This code produces the following output:
                
                Engineering: 350000.0000
                */
            }
        }
    }
    

    Example Refer To

    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon