Udostępnij za pośrednictwem


EntitySetController<TEntity, TKey>.GetEntityByKey Method (TKey)

 

This method should be overridden to retrieve an entity by key from the entity set.

Namespace:   System.Web.Http.OData
Assembly:  System.Web.Http.OData (in System.Web.Http.OData.dll)

Syntax

protected internal virtual TEntity GetEntityByKey(
    TKey key
)
public protected:
virtual TEntity GetEntityByKey(
    TKey key
)
abstract GetEntityByKey : 
        key:'TKey -> 'TEntity
override GetEntityByKey : 
        key:'TKey -> 'TEntity
Protected Friend Overridable Function GetEntityByKey (
    key As TKey
) As TEntity

Parameters

  • key
    Type: TKey

    The entity key of the entity to retrieve.

Return Value

Type: TEntity

The retrieved entity, or null if an entity with the specified entity key cannot be found in the entity set.

See Also

EntitySetController<TEntity, TKey> Class
System.Web.Http.OData Namespace

Return to top