Share via


MetaTable.GetPrimaryKeyDictionary(Object) Yöntem

Tanım

Belirtilen satır için birincil anahtar adlarından ve değerlerinden oluşan bir sözlük alır.

public:
 virtual System::Collections::Generic::IDictionary<System::String ^, System::Object ^> ^ GetPrimaryKeyDictionary(System::Object ^ row);
public System.Collections.Generic.IDictionary<string,object> GetPrimaryKeyDictionary (object row);
abstract member GetPrimaryKeyDictionary : obj -> System.Collections.Generic.IDictionary<string, obj>
override this.GetPrimaryKeyDictionary : obj -> System.Collections.Generic.IDictionary<string, obj>
Public Function GetPrimaryKeyDictionary (row As Object) As IDictionary(Of String, Object)

Parametreler

row
Object

Bir satır.

Döndürülenler

Birincil anahtar adlarının ve değerlerinin sözlüğü.

Örnekler

Aşağıdaki örnekte birincil anahtar sözlüğü oluşturma gösterilmektedir.

private RouteValueDictionary GetRouteValues(MetaTable table, object row) {  
    RouteValueDictionary routeValues = GetRouteValues();  
    foreach (var pk in table.GetPrimaryKeyDictionary(row)) {  
        routeValues[pk.Key] = pk.Value;  
    }  
    return routeValues;  
}   
Private Function GetRouteValues(ByVal table As MetaTable, _  
        ByVal row As Object) As RouteValueDictionary   
    Dim routeValues As RouteValueDictionary = GetRouteValues()   
    For Each pk In table.GetPrimaryKeyDictionary(row)   
        routeValues(pk.Key) = pk.Value   
    Next   
    Return routeValues   
End Function   

Şunlara uygulanır