Class HasNestedDataSetsExtensions
- Namespace
- BpNexT.NET.Extensions.Internal
- Assembly
- BpNexT.NET.dll
Provides extension methods for the IHasNestedDataSets interface.
public static class HasNestedDataSetsExtensions
- Inheritance
-
objectHasNestedDataSetsExtensions
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
dataSetIHasNestedDataSetsThe AutoDataSet to append to.
Returns
- T
An instance of type T with properties populated from the AutoDataSet.
Type Parameters
TThe 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
dataSetIHasNestedDataSets
Returns
- AutoDataSet
Exceptions
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
dataSetIHasNestedDataSetsincludesstring[]
Returns
- IEnumerable<T>
Type Parameters
TThe 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
dataSetIHasNestedDataSetsincludesstring[]chunkSizeint
Returns
- IEnumerable<T>
Type Parameters
TThe DataSet type.