Skip to content

DiGi.PostgreSQL.UniqueReference.Classes

github-actions[bot] edited this page Jul 15, 2026 · 2 revisions

DiGi.PostgreSQL.UniqueReference.Classes Namespace

Classes

UniqueIdReferenceGeneratingEventArgs Class

Event arguments used during the generation of a unique ID reference.

public class UniqueIdReferenceGeneratingEventArgs : DiGi.PostgreSQL.Classes.ReferenceGeneratingEventArgs

Inheritance System.Object → System.EventArgs → DiGi.PostgreSQL.Classes.ReferenceGeneratingEventArgs → UniqueIdReferenceGeneratingEventArgs

Constructors

UniqueIdReferenceGeneratingEventArgs(object) Constructor

Initializes a new instance of the UniqueIdReferenceGeneratingEventArgs class.

public UniqueIdReferenceGeneratingEventArgs(object? item);

Parameters

item System.Object

The item for which the reference is being generated.

Properties

UniqueIdReferenceGeneratingEventArgs.UniqueId Property

Gets or sets the unique identifier string associated with this reference.

public string? UniqueId { get; set; }

Property Value

System.String

UniqueIdReferenceGeneratingEventArgs.UniqueIdReference Property

Gets the constructed UniqueIdReference based on the item type and the provided unique identifier.

public DiGi.Core.Classes.UniqueIdReference? UniqueIdReference { get; }

Property Value

DiGi.Core.Classes.UniqueIdReference

UniqueReferencePostgreSQLConverter Class

Provides a specialized PostgreSQL converter for unique references specifically targeting objects that implement the DiGi.Core.Interfaces.ISerializableObject interface.

public class UniqueReferencePostgreSQLConverter : DiGi.PostgreSQL.UniqueReference.Classes.UniqueReferencePostgreSQLConverter<DiGi.Core.Interfaces.ISerializableObject>

Inheritance System.Object → DiGi.PostgreSQL.Classes.PostgreSQLConverter<DiGi.Core.Interfaces.ISerializableObject> → DiGi.PostgreSQL.UniqueReference.Classes.UniqueReferencePostgreSQLConverter<DiGi.Core.Interfaces.ISerializableObject> → UniqueReferencePostgreSQLConverter

Constructors

UniqueReferencePostgreSQLConverter(ConnectionData) Constructor

Initializes a new instance of the UniqueReferencePostgreSQLConverter class using the specified connection data.

public UniqueReferencePostgreSQLConverter(DiGi.PostgreSQL.Classes.ConnectionData? connectionData);

Parameters

connectionData DiGi.PostgreSQL.Classes.ConnectionData

The connection data used to configure the PostgreSQL converter; may be null.

UniqueReferencePostgreSQLConverter<TSerializableObject> Class

Provides a PostgreSQL converter implementation specifically designed to handle unique references for objects that implement the DiGi.Core.Interfaces.ISerializableObject interface.

public class UniqueReferencePostgreSQLConverter<TSerializableObject> : DiGi.PostgreSQL.Classes.PostgreSQLConverter<TSerializableObject>
    where TSerializableObject : DiGi.Core.Interfaces.ISerializableObject

Type parameters

TSerializableObject

The type of the serializable object being converted, which must implement the DiGi.Core.Interfaces.ISerializableObject interface.

Inheritance System.Object → DiGi.PostgreSQL.Classes.PostgreSQLConverter<TSerializableObject> → UniqueReferencePostgreSQLConverter<TSerializableObject>

Derived
↳ UniqueReferencePostgreSQLConverter

Constructors

UniqueReferencePostgreSQLConverter(ConnectionData) Constructor

Initializes a new instance of the UniqueReferencePostgreSQLConverter class.

public UniqueReferencePostgreSQLConverter(DiGi.PostgreSQL.Classes.ConnectionData? connectionData);

Parameters

connectionData DiGi.PostgreSQL.Classes.ConnectionData

The connection data used to configure the PostgreSQL database connection; can be null.

Methods

UniqueReferencePostgreSQLConverter<TSerializableObject>.ContainsAsync(Type) Method

Asynchronously determines whether the container contains the specified type.

public System.Threading.Tasks.Task<bool> ContainsAsync(System.Type? type);

Parameters

type System.Type

The System.Type to locate in the container. This value can be null.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result contains true if the specified type is found; otherwise, false.

UniqueReferencePostgreSQLConverter<TSerializableObject>.ContainsAsync<TUniqueReference>(IEnumerable<TUniqueReference>) Method

Asynchronously checks for the existence of a collection of unique references and returns those that are present.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<TUniqueReference>?> ContainsAsync<TUniqueReference>(System.Collections.Generic.IEnumerable<TUniqueReference>? uniqueReferences)
    where TUniqueReference : DiGi.Core.Interfaces.IUniqueReference;

Type parameters

TUniqueReference

The type of the unique reference, which must implement the DiGi.Core.Interfaces.IUniqueReference interface.

Parameters

uniqueReferences System.Collections.Generic.IEnumerable<TUniqueReference>

An optional enumerable collection of unique references to verify.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<TUniqueReference>>
A task that represents the asynchronous operation. The task result contains a System.Collections.Generic.HashSet<> of existing references, or null if no references were provided or found.

UniqueReferencePostgreSQLConverter<TSerializableObject>.CountAsync(Type, bool) Method

Asynchronously counts the number of elements associated with the specified type.

public System.Threading.Tasks.Task<long> CountAsync(System.Type? type, bool inheritance=true);

Parameters

type System.Type

The System.Type to count. If null, the behavior is determined by the underlying implementation.

inheritance System.Boolean

A value indicating whether to include types derived from the specified type in the count. Defaults to true.

Returns

System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total count as a System.Int64.

UniqueReferencePostgreSQLConverter<TSerializableObject>.CountAsync<USerializableObject>(bool) Method

Asynchronously counts the total number of records for the specified serializable object type.

public System.Threading.Tasks.Task<long> CountAsync<USerializableObject>(bool inheritance=true)
    where USerializableObject : TSerializableObject;

Type parameters

USerializableObject

The type of the serializable object to count, which must derive from TSerializableObject.

Parameters

inheritance System.Boolean

A value indicating whether to include types derived from USerializableObject in the count. Defaults to true.

Returns

System.Threading.Tasks.Task<System.Int64>
A task that represents the asynchronous operation. The task result contains the total number of records as a System.Int64.

UniqueReferencePostgreSQLConverter<TSerializableObject>.GetDataType(Type) Method

Retrieves the corresponding DiGi.PostgreSQL.Enums.DataType for the specified .NET type.

public virtual DiGi.PostgreSQL.Enums.DataType GetDataType(System.Type? type);

Parameters

type System.Type

The .NET type to map to a DiGi.PostgreSQL.Enums.DataType. This value can be null.

Returns

DiGi.PostgreSQL.Enums.DataType
The DiGi.PostgreSQL.Enums.DataType that represents the provided type.

UniqueReferencePostgreSQLConverter<TSerializableObject>.GetDataType<USerializableObject>() Method

Retrieves the DiGi.PostgreSQL.Enums.DataType associated with the specified serializable object type.

public DiGi.PostgreSQL.Enums.DataType GetDataType<USerializableObject>()
    where USerializableObject : TSerializableObject;

Type parameters

USerializableObject

The type of the serializable object, which must derive from TSerializableObject.

Returns

DiGi.PostgreSQL.Enums.DataType
The DiGi.PostgreSQL.Enums.DataType corresponding to the provided generic type.

UniqueReferencePostgreSQLConverter<TSerializableObject>.GetSerializableObjectAsync<USerializableObject>(IUniqueReference) Method

Asynchronously retrieves a serializable object associated with the specified unique reference.

public System.Threading.Tasks.Task<USerializableObject?> GetSerializableObjectAsync<USerializableObject>(DiGi.Core.Interfaces.IUniqueReference? uniqueReference)
    where USerializableObject : TSerializableObject;

Type parameters

USerializableObject

The type of the serializable object to retrieve, which must derive from TSerializableObject.

Parameters

uniqueReference DiGi.Core.Interfaces.IUniqueReference

The unique reference used to identify the object. May be null.

Returns

System.Threading.Tasks.Task<USerializableObject>
A task that represents the asynchronous operation. The task result contains the retrieved serializable object if found; otherwise, null.

UniqueReferencePostgreSQLConverter<TSerializableObject>.GetSerializableObjectsAsync<USerializableObject,TUniqueReference>(IEnumerable<TUniqueReference>) Method

Asynchronously retrieves a list of serializable objects associated with the provided unique references.

public System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>?> GetSerializableObjectsAsync<USerializableObject,TUniqueReference>(System.Collections.Generic.IEnumerable<TUniqueReference>? uniqueReferences)
    where USerializableObject : TSerializableObject
    where TUniqueReference : DiGi.Core.Interfaces.IUniqueReference;

Type parameters

USerializableObject

The type of serializable object to retrieve, which must derive from TSerializableObject.

TUniqueReference

The type of unique reference used for identification, which must implement DiGi.Core.Interfaces.IUniqueReference.

Parameters

uniqueReferences System.Collections.Generic.IEnumerable<TUniqueReference>

An optional collection of unique references to be used as keys for retrieving the objects.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>>
A task that represents the asynchronous operation. The task result contains a list of retrieved serializable objects, or null if the input references were null or no objects could be found.

UniqueReferencePostgreSQLConverter<TSerializableObject>.GetSerializableObjectsAsync<USerializableObject>(bool) Method

Asynchronously retrieves a list of serializable objects from the data store.

public System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>?> GetSerializableObjectsAsync<USerializableObject>(bool inheritance=true)
    where USerializableObject : TSerializableObject;

Type parameters

USerializableObject

The type of serializable object to retrieve, which must derive from TSerializableObject.

Parameters

inheritance System.Boolean

A value indicating whether to include types derived from USerializableObject in the results. Defaults to true.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<USerializableObject>>
A task that represents the asynchronous operation. The task result contains a list of objects of type USerializableObject, or null if no objects are found.

UniqueReferencePostgreSQLConverter<TSerializableObject>.RemoveAsync(Type, bool) Method

Asynchronously removes the specified type from the collection.

public System.Threading.Tasks.Task<bool> RemoveAsync(System.Type? type, bool inheritance=true);

Parameters

type System.Type

The System.Type to remove. Can be null.

inheritance System.Boolean

A value indicating whether types that inherit from the specified type should also be removed. Defaults to true.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result contains true if the type was successfully removed; otherwise, false.

UniqueReferencePostgreSQLConverter<TSerializableObject>.RemoveAsync<TUniqueReference>(IEnumerable<TUniqueReference>) Method

Asynchronously removes the entities associated with the specified collection of unique references.

public System.Threading.Tasks.Task<System.Collections.Generic.List<TUniqueReference>?> RemoveAsync<TUniqueReference>(System.Collections.Generic.IEnumerable<TUniqueReference>? uniqueReferences)
    where TUniqueReference : DiGi.Core.Interfaces.IUniqueReference;

Type parameters

TUniqueReference

The type of the unique reference, which must implement DiGi.Core.Interfaces.IUniqueReference.

Parameters

uniqueReferences System.Collections.Generic.IEnumerable<TUniqueReference>

An optional collection of unique references to be removed.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.List<TUniqueReference>>
A task that represents the asynchronous operation. The task result contains a list of the unique references that were successfully removed, or null if the input was null or no items were removed.

UniqueReferencePostgreSQLConverter<TSerializableObject>.RemoveAsync<TUniqueReference>(TUniqueReference) Method

Asynchronously removes an item identified by the specified unique reference.

public System.Threading.Tasks.Task<TUniqueReference?> RemoveAsync<TUniqueReference>(TUniqueReference? uniqueReference)
    where TUniqueReference : DiGi.Core.Interfaces.IUniqueReference;

Type parameters

TUniqueReference

The type of the unique reference, which must implement DiGi.Core.Interfaces.IUniqueReference.

Parameters

uniqueReference TUniqueReference

The unique reference of the item to be removed. This value can be null.

Returns

System.Threading.Tasks.Task<TUniqueReference>
A task that represents the asynchronous operation. The task result contains the removed unique reference if the operation was successful; otherwise, null.

UniqueReferencePostgreSQLConverter<TSerializableObject>.RemoveAsync<USerializableObject>(bool) Method

Asynchronously removes an object of the specified serializable type from the data store.

public System.Threading.Tasks.Task<bool> RemoveAsync<USerializableObject>(bool inheritance=true)
    where USerializableObject : TSerializableObject;

Type parameters

USerializableObject

The type of the serializable object to remove, which must derive from TSerializableObject.

Parameters

inheritance System.Boolean

A value indicating whether the removal process should include inherited types. Defaults to true.

Returns

System.Threading.Tasks.Task<System.Boolean>
A task that represents the asynchronous operation. The task result contains true if the object was successfully removed; otherwise, false.

UniqueReferencePostgreSQLConverter<TSerializableObject>.UpdateAsync(TSerializableObject) Method

Asynchronously updates the specified serializable object in the data store.

public System.Threading.Tasks.Task<DiGi.Core.Classes.UniqueReference?> UpdateAsync(TSerializableObject? serializableObject);

Parameters

serializableObject TSerializableObject

The serializable object instance to update. Can be null.

Returns

System.Threading.Tasks.Task<DiGi.Core.Classes.UniqueReference>
A task that represents the asynchronous operation. The task result contains the DiGi.Core.Classes.UniqueReference of the updated object, or null if the update could not be completed or the input was null.

UniqueReferencePostgreSQLConverter<TSerializableObject>.UpdateAsync<USerializableObject>(IEnumerable<USerializableObject>) Method

Asynchronously updates a collection of serializable objects and returns the set of unique references associated with the updated entities.

public System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.Core.Classes.UniqueReference>?> UpdateAsync<USerializableObject>(System.Collections.Generic.IEnumerable<USerializableObject>? serializableObjects)
    where USerializableObject : TSerializableObject;

Type parameters

USerializableObject

The type of the serializable object to update, which must implement or derive from TSerializableObject.

Parameters

serializableObjects System.Collections.Generic.IEnumerable<USerializableObject>

An optional collection of objects to be processed for updates.

Returns

System.Threading.Tasks.Task<System.Collections.Generic.HashSet<DiGi.Core.Classes.UniqueReference>>
A task that represents the asynchronous operation. The task result contains a HashSet of UniqueReference of unique references if the update was performed; otherwise, null.

Events

UniqueReferencePostgreSQLConverter<TSerializableObject>.UniqueIdReferenceGenerating Event

Occurs when a unique identifier reference is being generated.

public event UniqueIdReferenceGeneratingEventHandler? UniqueIdReferenceGenerating;

Event Type

UniqueIdReferenceGeneratingEventHandler(object, UniqueIdReferenceGeneratingEventArgs)

Clone this wiki locally