Table of Contents

Class HasNestedDataSetsExtensions

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

Provides extension methods for the IHasNestedDataSets interface.

public static class HasNestedDataSetsExtensions
Inheritance
object
HasNestedDataSetsExtensions

Methods

AppendNested<T>(IHasNestedDataSets)

Appends a new instance to the Nested AutoDataSet of type T.

public static T AppendNested<T>(this IHasNestedDataSets dataSet) where T : IHasAutoDataSet, new()

Parameters

dataSet IHasNestedDataSets

The AutoDataSet to append to.

Returns

T

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

Type Parameters

T

The type of the object to append, which must inherit from HasAutoDataSet and have a parameterless constructor.

GetNewParentDataSet(IHasNestedDataSets)

Gets a new parent DataSet for the current object, duplicating the current state if necessary.

public static AutoDataSet GetNewParentDataSet(this IHasNestedDataSets dataSet)

Parameters

dataSet IHasNestedDataSets

Returns

AutoDataSet

Exceptions

InvalidOperationException

GetRelatedEntities<T>(IHasNestedDataSets, string[]?)

Dynamic access to the items of a nested datasets.

public static IEnumerable<T> GetRelatedEntities<T>(this IHasNestedDataSets dataSet, string[]? includes = null) where T : IHasAutoDataSet, new()

Parameters

dataSet IHasNestedDataSets
includes string[]

Returns

IEnumerable<T>

Type Parameters

T

The type of the nested dataset.

ReadRelatedEntities<T>(IHasNestedDataSets, string[]?, int)

Returns an IQueryable for the specified DataSet type, automatically optimizing queries using available indices where possible.

public static IEnumerable<T> ReadRelatedEntities<T>(this IHasNestedDataSets dataSet, string[]? includes = null, int chunkSize = 1000) where T : IHasAutoDataSet, new()

Parameters

dataSet IHasNestedDataSets
includes string[]
chunkSize int

Returns

IEnumerable<T>

Type Parameters

T

The DataSet type.