LinkGenerationHelpers.GenerateNavigationPropertyLink Method
Generates a navigation link following the OData URL conventions for the entity represented by entityContext and the given navigation property.
Namespace: System.Web.Http.OData.Builder
Assembly: System.Web.Http.OData (in System.Web.Http.OData.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function GenerateNavigationPropertyLink ( _
entityContext As EntityInstanceContext, _
navigationProperty As IEdmNavigationProperty, _
includeCast As Boolean _
) As Uri
'Usage
Dim entityContext As EntityInstanceContext
Dim navigationProperty As IEdmNavigationProperty
Dim includeCast As Boolean
Dim returnValue As Uri
returnValue = entityContext.GenerateNavigationPropertyLink(navigationProperty, _
includeCast)
public static Uri GenerateNavigationPropertyLink(
this EntityInstanceContext entityContext,
IEdmNavigationProperty navigationProperty,
bool includeCast
)
[ExtensionAttribute]
public:
static Uri^ GenerateNavigationPropertyLink(
EntityInstanceContext^ entityContext,
IEdmNavigationProperty^ navigationProperty,
bool includeCast
)
static member GenerateNavigationPropertyLink :
entityContext:EntityInstanceContext *
navigationProperty:IEdmNavigationProperty *
includeCast:bool -> Uri
public static function GenerateNavigationPropertyLink(
entityContext : EntityInstanceContext,
navigationProperty : IEdmNavigationProperty,
includeCast : boolean
) : Uri
Parameters
- entityContext
Type: System.Web.Http.OData.EntityInstanceContext
The EntityInstanceContext representing the entity for which the navigation link needs to be generated.
- navigationProperty
Type: IEdmNavigationProperty
The EDM navigation property.
- includeCast
Type: System.Boolean
Represents whether the generated link should have a cast segment representing a type cast.
Return Value
Type: System.Uri
The navigation link following the OData URL conventions.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type EntityInstanceContext. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.111) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.111).