Table of Contents

Class HasAutoDataSetPersistenceExtensions

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

Persistence and conversion operations for HasAutoDataSet entities. IHasAutoDataSet declares Save/Remove/As directly, so contracts-only modules can persist entities; the proprietary implementation lives in this assembly and is dispatched via BpNexT.NET.Models.HasAutoDataSet.HasAutoDataSetRuntime. The methods here remain as forwarders for source compatibility.

public static class HasAutoDataSetPersistenceExtensions
Inheritance
object
HasAutoDataSetPersistenceExtensions

Methods

As<T>(IHasAutoDataSet, string[]?)

Converts the current generic instance to it's typed instance.

public static T As<T>(this IHasAutoDataSet entity, string[]? includes = null) where T : IHasAutoDataSet, new()

Parameters

entity IHasAutoDataSet

The entity to convert.

includes string[]

Optional: The names of the properties to include.

Returns

T

A new instance of the target type.

Type Parameters

T

The target type.

Exceptions

InvalidOperationException

Thrown when DataSet is null or the DataSet type does not match the target type name.

GetSelektionsFeld(IHasAutoDataSet, string)

Retrieves a SelektionsFeld object by its name or Bez property.

public static SelektionsFeld? GetSelektionsFeld(this IHasAutoDataSet entity, string name)

Parameters

entity IHasAutoDataSet

The entity whose SelektionsFelder to search.

name string

The name or Bez of the SelektionsFeld to retrieve.

Returns

SelektionsFeld

The SelektionsFeld object if found; otherwise, null.

GetSelektionsFeldValue<T>(IHasAutoDataSet, string)

Retrieves the value of a specific SelektionsFeld object and converts it to the specified type.

public static T? GetSelektionsFeldValue<T>(this IHasAutoDataSet entity, string name)

Parameters

entity IHasAutoDataSet

The entity whose SelektionsFeld value to read.

name string

The name of the SelektionsFeld whose value is to be retrieved.

Returns

T

The value of the SelektionsFeld converted to the specified type.

Type Parameters

T

The type to which the value should be converted.

Exceptions

InvalidOperationException

Thrown when the DataSet is not attached or the SelektionsFeld is not found.

GetSelektionsFelderValues(IHasAutoDataSet)

Retrieves the values of all SelektionsFeld objects in a dictionary.

public static List<SelektionsFeldValue> GetSelektionsFelderValues(this IHasAutoDataSet entity)

Parameters

entity IHasAutoDataSet

Returns

List<SelektionsFeldValue>

A dictionary containing the names and values of all SelektionsFeld objects.

Exceptions

InvalidOperationException

Thrown when the DataSet is not attached.

Remove(IHasAutoDataSet)

Removes the current instance from the DataSet.

public static void Remove(this IHasAutoDataSet entity)

Parameters

entity IHasAutoDataSet

Exceptions

InvalidOperationException

Thrown when DataSet is null.

Save(IHasAutoDataSet)

Saves the current state of the object to the DataSet.

public static void Save(this IHasAutoDataSet entity)

Parameters

entity IHasAutoDataSet

Exceptions

InvalidOperationException

Thrown when DataSet is null.