Class HasAutoDataSet
- Namespace
- BpNexT.NET.Models.HasAutoDataSet
- Assembly
- BpNexT.NET.dll
Base class for objects that are part of an AutoDataSet.
public class HasAutoDataSet : IHasAutoDataSet, IDisposable
- Inheritance
-
objectHasAutoDataSet
- Implements
- Extension Methods
Properties
ApplicationInstanceId
The Büro+ application instance this object belongs to.
[JsonIgnore]
[ValidateNever]
public Guid ApplicationInstanceId { get; set; }
Property Value
Bookmark
Unique identifier for the object. From Büro+
[JsonIgnore]
[ValidateNever]
public string? Bookmark { get; set; }
Property Value
BpApp
The Büro+ application instance this object belongs to.
[JsonIgnore]
[ValidateNever]
public BpApplication BpApp { get; }
Property Value
DataSet
Access to the original AutoDataSet.
[JsonIgnore]
public AutoDataSet? DataSet { get; set; }
Property Value
- AutoDataSet
HasChanges
Indicates whether the object has changes.
[JsonIgnore]
public bool HasChanges { get; }
Property Value
- bool
trueif the object has changes; otherwise,false.
Identifier
Unique identifier for the object.
[JsonIgnore]
[ValidateNever]
public string Identifier { get; set; }
Property Value
Parent
Parent object that contains this instance, if any.
[JsonIgnore]
public IHasAutoDataSet? Parent { get; set; }
Property Value
ParentBookmark
Unique identifier for the parent object. From Büro+
[JsonIgnore]
[ValidateNever]
public string? ParentBookmark { get; set; }
Property Value
ParentDataSet
Access to the original Parent AutoDataSet, if any.
[JsonIgnore]
public AutoDataSet? ParentDataSet { get; set; }
Property Value
- AutoDataSet
SelektionsFelder
SelektionsFelder of the DataSet.
[JsonIgnore]
public List<SelektionsFeld> SelektionsFelder { get; init; }
Property Value
Methods
As<T>(string[]?)
Converts the current generic instance to it's typed instance.
public T As<T>(string[]? includes = null) where T : IHasAutoDataSet, new()
Parameters
includesstring[]Optional: The names of the properties to include.
Returns
- T
A new instance of the target type.
Type Parameters
TThe target type.
Exceptions
- InvalidOperationException
Thrown when DataSet is null or the DataSet type does not match the target type name.
CopyFrom<T>(T)
Copies properties from another instance of HasAutoDataSet.
public void CopyFrom<T>(T other) where T : IHasAutoDataSet
Parameters
otherTThe other instance to copy from.
Type Parameters
TThe type of the other instance.
Exceptions
- ArgumentException
Thrown when the type of the other instance does not match the current type.
Dispose()
Releases unmanaged and managed resources.
public void Dispose()
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)
Parameters
disposingbooltrueto release both managed and unmanaged resources;falseto release only unmanaged resources.
FillFrom<T>(T)
Fills empty properties from another instance of HasAutoDataSet.
public void FillFrom<T>(T other) where T : IHasAutoDataSet
Parameters
otherTThe other instance to copy from.
Type Parameters
TThe type of the other instance.
Exceptions
- ArgumentException
Thrown when the type of the other instance does not match the current type.
~HasAutoDataSet()
Finalizer for automatic cleanup by the Garbage Collector.
protected ~HasAutoDataSet()
GetAdjustedDataSet()
Retrieves the adjusted DataSet.
public AutoDataSet? GetAdjustedDataSet()
Returns
- AutoDataSet
GetAdjustedParentDataSet()
Retrieves the adjusted parent DataSet.
public AutoDataSet? GetAdjustedParentDataSet()
Returns
- AutoDataSet
GetSelektionsFeld(string)
Retrieves a SelektionsFeld object by its name or Bez property.
public SelektionsFeld? GetSelektionsFeld(string name)
Parameters
namestringThe name or Bez of the SelektionsFeld to retrieve.
Returns
- SelektionsFeld
The SelektionsFeld object if found; otherwise, null.
GetSelektionsFeldValue<T>(string)
Retrieves the value of a specific SelektionsFeld object and converts it to the specified type.
public T? GetSelektionsFeldValue<T>(string name)
Parameters
namestringThe name of the SelektionsFeld whose value is to be retrieved.
Returns
- T
The value of the SelektionsFeld converted to the specified type.
Type Parameters
TThe type to which the value should be converted.
Exceptions
- InvalidOperationException
Thrown when the DataSet is not attached or the SelektionsFeld is not found.
GetSelektionsFelderValues()
Retrieves the values of all SelektionsFeld objects in a dictionary.
public List<SelektionsFeldValue> GetSelektionsFelderValues()
Returns
- List<SelektionsFeldValue>
A dictionary containing the names and values of all SelektionsFeld objects.
Exceptions
- InvalidOperationException
Thrown when the DataSet is not attached.
Remove()
Removes the current instance from the DataSet.
public void Remove()
Exceptions
- InvalidOperationException
Thrown when DataSet is null.
ResetChanges()
Resets the change tracking. Does NOT reset the Object.
public void ResetChanges()
Save()
Saves the current state of the object to the DataSet.
public void Save()
Exceptions
- InvalidOperationException
Thrown when DataSet is null.