Show / Hide Table of Contents

    DataStore.DataStore(string dataObject, IEnumerable<IModelEntry> modelEntries) Constructor

    .NET Standard 2.x

    Initializes a new instance of the DataStore class using a DataWindow object and a sequence of IModelEntry objects.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      public DataStore(string dataObject, IEnumerable<IModelEntry> modelEntries);
    

    Parameters

    dataObject System.String

    The name of a DataWindow object.

    modelEntries System.Collections.Generic.IEnumerable<SnapObjects.Data.IModelEntry>

    A sequence of IModelEntry objects which contain data and state.

    Examples

    The following code example creates a DataStore object and inserts data to it.

    using SnapObjects.Data;
    using DWNet.Data;
    using System;
    using System.Collections.Generic;
    using Appeon.ApiDoc.Models;
    
    namespace Appeon.ApiDoc.DataStoreExamples
    {
        public class DataStoreExample
        {
            private readonly SchoolContext _context;
    
            public DataStoreExample(SchoolContext dataContext)
            {
                // Set Data Context
                _context = dataContext;
            }
    
            public void Example4(IEnumerable<IModelEntry> modelEntries)
            {
                // Instantiates the datastore with d_department DataWindow
                var department = new DataStore("d_person", modelEntries);
    
                int row = department.RowCount;
                Console.WriteLine("Row Count = {0}", row);
    
                /*This code produces the following output:
                
                Row Count = 2    
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    Controller Class: DataStoreExampleController
    DataWindow File: d_department

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon