TX Text Control .NET Server

LoadObjects Method

Method|Introduced in 24.0
Namespace
TXTextControl.DocumentServer.DataSources
Package
TXTextControl.TextControl.Core.SDK as TXDocumentServer.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXDocumentServer.dll

Description

Loads a collection implementing the interface IEnumerable as a data source and deduces the data tables, column names and data relations from the public properties and used classes of the first contained object using .NET reflection or, in case of the first contained object being a Dictionary with string keys, from the key names and value types.

Syntax

public void LoadObjects(IEnumerable objects);

Parameters

ParameterDescription
objects

A collection implementing interface System.Collections.IEnumerable containing objects of any type. The existing tables, ccolumns and data relations are deduced from the the first contained object.

Examples

The following example uses Load Objects in a focused Data Source Manager workflow. The created object is then available to the surrounding document workflow.

dataSourceManager.LoadObjects(new UserDefinedPropertyDictionary());
Console.WriteLine("Data Source Manager is ready for use.");