Show / Hide Table of Contents

    IDataStoreBase.ImportEntry(IEnumerable<IModelEntry> entries) Method

    .NET Standard 2.x

    Imports a sequence of IModelEntry objects, which contain data and state, to the end of the DataStore.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

      public int ImportEntry(IEnumerable<IModelEntry> entries);
    

    Parameters

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

    A sequence of IModelEntry objects which contain data and state.

    Returns

    System.Int32

    Returns the number of the IModelEntry objects that were imported if it succeeds.

    Examples

    The following example demonstrates how to add multiple rows of data via a sequence of ModelEntry objects 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 Example2(IEnumerable<IModelEntry<D_Person>> persondatas)
            {
                // Creates DataStore and imports multiple records.
                var person = new DataStore("d_person", _context);
    
                person.ImportEntry(persondatas);
    
                Console.WriteLine("Rowcount: {0}", person.RowCount);
    
                /* The code example produces the following output:
                
                Rowcount: 2
                */
            }
        }
    }
    

    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