AdvantageCMS.Core.Common.BaseClasses Namespace
Advantage CSP

AdvantageModuleEngine..::..GetPublishedKeyValueObjects<(Of <(<'T, Y>)>)> Method (String, List<(Of <(<'Guid>)>)>)

Retrieves a list of values of a specified type Y from key-value pairs based on a provided key name and optional list of master IDs.

Namespace:  AdvantageCMS.Core.Common.Engine
Assembly:  AdvantageCMS.Core (in AdvantageCMS.Core.dll)

Syntax


public List<Y> GetPublishedKeyValueObjects<T, Y>(
	string keyName,
	List<Guid> masterIds
)
where T : BusinessObject<T>, BusinessObject<T>

Type Parameters

T
The type of the business object, inheriting from BusinessObject<(Of <(<'T>)>)>.
Y
The type of the value to retrieve (e.g., Int32, Guid, String, etc.).

Parameters

keyName
Type: String
The name of the key whose values should be retrieved.
masterIds
Type: List<(Of <(<'Guid>)>)>
An optional list of master IDs to filter the results by specific objects. If null or empty, no filtering on master IDs is applied.

Return Value

A list of values of type Y that match the specified key name and, if provided, the master IDs.

Examples


Sample usage:
C#
// Example: Retrieving integer values for a specific key name from selected master IDs.
var keyValues = GetPublishedKeyValueObjects<BusinessObject, int>("SomeKeyName", new List<Guid>
{
    Guid.Parse("3d9b2f50-9edc-4c7d-9a6c-2e7897d5b50b"),
    Guid.Parse("b839a4e1-91cd-4d3f-b3ab-8a2fb5d775f2")
});

// keyValues will contain a list of integers retrieved based on the key name "SomeKeyName".