Show / Hide Table of Contents

    IDataStoreBase.ImportEntry(IModelEntry entry) Method

    .NET Standard 2.x

    Imports an IModelEntry object, which contains data and state, to the end of the DataStore.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      public int ImportEntry(IModelEntry entry);
    

    Parameters

    entry SnapObjects.Data.IModelEntry

    An IModelEntry object which contains data and state.

    Returns

    System.Int32

    Returns 1 if succeeds.

    Examples

    The following example demonstrates how to add a row of data via a ModelEntry object to the DataStore.

    using SnapObjects.Data;
    using DWNet.Data;
    using System;
    using System.Collections.Generic;
    using Appeon.ApiDoc.Models;
    
    namespace Appeon.ApiDoc.IDataStoreBaseExamples
    {
        public class ImportEntryExample
        {
            private readonly SchoolContext _context;
    
            public ImportEntryExample(SchoolContext dataContext)
            {
                // Sets the data context.
                _context = dataContext;
            }
    
            public void Example1(IModelEntry<D_Person> persondata)
            {
                // Creates DataStore and imports a record.
                var person = new DataStore("d_person", _context);
    
                person.ImportEntry(persondata);
    
                Console.WriteLine("Rowcount: {0}", person.RowCount);
    
                /* The code example produces the following output:
                
                Rowcount: 1
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Person
    Controller Class: ImportEntryExampleController
    DataWindow File: d_person

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon