Click or drag to resize

DataTableBuildersbuildDataTable Method (IEnumerable, String, Boolean, Boolean, PropertyCollectionExtended, String)

imbSCI | imbACE | imbNLP | imbWEM | imbWBI
2017::Builds data table out of collection. Supported properties: primitives, enums and IGetFromToString interface types

Namespace:  imbSCI.DataComplex.extensions.data.schema
Assembly:  imbSCI.DataComplex (in imbSCI.DataComplex.dll) Version: 0.3.70.
Syntax
C#
public static DataTable buildDataTable(
	this IEnumerable items,
	string __dataTable,
	bool doOnlyWithDisplayName,
	bool doInherited,
	PropertyCollectionExtended dictionary,
	params string[] fieldsOrCategoriesToShow
)
Request Example View Source

Parameters

items
Type: System.CollectionsIEnumerable
__dataTable
Type: SystemString
Name of data table. If empty or null = type name is used.
doOnlyWithDisplayName
Type: SystemBoolean
Only properties with DisplayName attribute. Value of attribute will be mapped to Caption of column
doInherited
Type: SystemBoolean
Should inherited properties be included? FALSE to get only properties declared at class of the object
dictionary
Type: imbSCI.Core.collectionPropertyCollectionExtended
fieldsOrCategoriesToShow
Type: SystemString
Category or property name to include in DataTable. If its empty it will ignore this criteria

Return Value

Type: DataTable
DataTable object with proper DataColumn shema made from Primitive, Enum and ToStrings

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks

If fieldsCategoriesToShow[] parameters array is empty - filters are not applied

See Also