Table of Contents

Class AutoDataSetExtensions

Namespace
BpNexT.NET.Extensions
Assembly
BpNexT.NET.dll

Provides extension methods for the AutoDataSet class.

public static class AutoDataSetExtensions
Inheritance
object
AutoDataSetExtensions

Methods

As<T>(AutoDataSet, Guid, AutoDataSet?, string[]?, IHasNestedDataSets?)

Converts an AutoDataSet to an instance of type T.

public static T As<T>(this AutoDataSet dataSet, Guid applicationInstanceId, AutoDataSet? parentDataSet = null, string[]? includes = null, IHasNestedDataSets? parentObject = null) where T : IHasAutoDataSet, new()

Parameters

dataSet AutoDataSet

The AutoDataSet to convert.

applicationInstanceId Guid

The instance ID

parentDataSet AutoDataSet

The parent AutoDataSet, for NestedDataSets.

includes string[]

Optional properties to include in the conversion.

parentObject IHasNestedDataSets

The parent object that contains the AutoDataSet, if applicable.

Returns

T

An instance of type T with properties populated from the AutoDataSet.

Type Parameters

T

The type to convert to, which must inherit from HasAutoDataSet and have a parameterless constructor.

FillFrom<T>(AutoDataSet, T)

Fills empty properties from another instance of HasAutoDataSet.

public static void FillFrom<T>(this AutoDataSet dataSet, T other) where T : IHasAutoDataSet

Parameters

dataSet AutoDataSet

The AutoDataSet to fill to.

other T

The other instance to copy from.

Type Parameters

T

The type of the other instance.

Exceptions

ArgumentException

Thrown when the type of the other instance does not match the current type.

GetDataSet<T>(AutoDataSet, string?)

Retrieves a dataset of the specified type with an optional filter.

public static FilterableDataSet<T> GetDataSet<T>(this AutoDataSet dataSet, string? filter = null) where T : IHasAutoDataSet, new()

Parameters

dataSet AutoDataSet

The dataset to retrieve data from.

filter string

Optional filter to apply to the dataset.

Returns

FilterableDataSet<T>

An enumerable collection of the specified type.

Type Parameters

T

The type of the dataset.

GetIdentifier(AutoDataSet?, AutoDataSet?)

Gets a unique identifier (within it's set) for the AutoDataSet.

public static string GetIdentifier(this AutoDataSet? dataSet, AutoDataSet? parentDataSet = null)

Parameters

dataSet AutoDataSet
parentDataSet AutoDataSet

Returns

string

GetIdentifier<T>(T?, object?)

Gets a unique identifier (within its set) for the AutoDataSet.

public static string GetIdentifier<T>(this T? dataSet, object? parentDataSet = null) where T : IHasAutoDataSet

Parameters

dataSet T
parentDataSet object

Returns

string

Type Parameters

T

ParseSelektionsFelder(AutoDataSet)

Parses the SelektionsFelder of an AutoDataSet.

public static List<SelektionsFeld> ParseSelektionsFelder(this AutoDataSet autoDataSet)

Parameters

autoDataSet AutoDataSet

The AutoDataSet to parse SelektionsFelder for

Returns

List<SelektionsFeld>

A list of SelektionsFelder

Save<T>(AutoDataSet, T, string[]?)

Saves the properties of an object to the corresponding AutoDataSet.

public static void Save<T>(this AutoDataSet dataSet, T obj, string[]? toMapValues = null)

Parameters

dataSet AutoDataSet

The AutoDataSet to save to.

obj T

The object to save.

toMapValues string[]

An optional array of property names to map values for.

Type Parameters

T

The type of the object to save.

TryPost(AutoDataSet)

Attempts to post the AutoDataSet.

public static bool TryPost(this AutoDataSet autoDataSet)

Parameters

autoDataSet AutoDataSet

The AutoDataSet to post.

Returns

bool

True if the post was successful, otherwise false.