Show / Hide Table of Contents

    IDataStore<TModel>.Count Property

    .NET Standard 2.x

    Gets the total number of rows in primary buffers of the DataStore.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      new int Count { get; }
    

    Property Value

    Sytem.Int

    Examples

    The following code example demonstrates how to use the Count property to count the total number of rows in the primary buffer of the DataStore.

    using Appeon.ApiDoc.Models;
    using DWNet.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDataStore_GenericExamples
    {
        public class CountExample
        {
            private readonly SchoolContext _context;
    
            public CountExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example()
            {
                // Instantiates datastore with datawindow: d_department
                var datastore = new DataStore<D_Department>(_context);
    
                datastore.Retrieve();
    
                Console.WriteLine("Number of primary buffer rows: ", datastore.Count);
    
                /*This code produces the following output:
                
                Number of primary buffer rows: 4
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    DataWindow File: d_department

    Back to top Generated by Appeon