Show / Hide Table of Contents

    IDataStore.ImportEntry(IEnumerable<IModelEntry> modelEntries) Method

    .NET Standard 2.x | Current Version (1.0.1)

    0.5.0-alpha

    1.0.1 (current)

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

    Namespace: PowerBuilder.Data

    Assembly: PowerBuilder.Data.dll

    Syntax

      public int ImportEntry(IEnumerable<IModelEntry> modelEntries);
    

    Parameters

    modelEntries 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 Appeon.ApiDoc.Models.School;
    using SnapObjects.Data;
    using PowerBuilder.Data;
    using System;
    using System.Collections.Generic;
    
    namespace Appeon.ApiDoc.IDataStoreExamples
    {
        public class ImportEntryExample
        {
            private readonly SchoolContext _context;
    
            public ImportEntryExample(SchoolContext dataContext)
            {
                // Sets the data context.
                _context = dataContext;
            }
    
            public void Example2(IEnumerable<IModelEntry<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

    Controller Class: ImportEntryExampleController

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon