MetaTable.GetPrimaryKeyDictionary(Object) Method

Definition

Retrieves a dictionary of primary-key names and values for the specified row.

C#
public System.Collections.Generic.IDictionary<string,object> GetPrimaryKeyDictionary(object row);

Parameters

row
Object

A row.

Returns

A dictionary of primary-key names and values.

Examples

The following example shows how to create a primary-key dictionary.

C#
private RouteValueDictionary GetRouteValues(MetaTable table, object row) {  
    RouteValueDictionary routeValues = GetRouteValues();  
    foreach (var pk in table.GetPrimaryKeyDictionary(row)) {  
        routeValues[pk.Key] = pk.Value;  
    }  
    return routeValues;  
}   

Applies to

Proizvod Verzije
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1