Show / Hide Table of Contents

    IDwDataExporter.ExportPlain() Method

    .NET Standard 2.x

    Exports entity class data from the DataStore primary buffer in the specified DataFormat.

    Namespace: DWNet.Data

    Assembly: DWNet.Data.dll

    Syntax

    string ExportPlain();
    

    Returns

    System.String

    Data string in the specified format.

    Reference Plain JSON

    Examples

    The following code example demonstrates how to export the department records from the primary buffer to a JSON string.

    using DWNet.Data;
    using SnapObjects.Data;
    using System;
    
    namespace Appeon.ApiDoc.IDwDataExporterExamples
    {
        public class ExportPlainExample
        {
            private readonly SchoolContext _context;
    
            public ExportPlainExample(SchoolContext dataContext)
            {
                // Sets the data context
                _context = dataContext;
            }
    
            public void Example1()
            {
                // Instantiates a DataStore object with datawindow: d_department.
                var datastore = new DataStore("d_department", _context);
    
                datastore.Retrieve();
    
                // Gets DataStore exporter in JSON format.
                var exporter = datastore.GetDataExporter(DataFormat.Json);
    			
    			// Exports data from the DataStore primary buffer in plain-JSON format.
                string json1 = exporter.ExportPlain();
    
                Console.WriteLine(json1);
    
                /*The exported JSON file is:
    
                ExportPlainJson1.json  
                */
            }
        }
    }
    

    Example Refer To

    Model Class: D_Department
    JSON File: ExportPlainJson1
    DataWindow File: d_department

    Back to top Generated by Appeon