MetaTable.GetPrimaryKeyDictionary(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves a dictionary of primary-key names and values for the specified row.
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)
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.
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
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET