Share via


ResourceContext Class

Definition

An instance of ResourceContext gets passed to the self link ( NavigationSourceConfiguration.HasIdLink, NavigationSourceConfiguration.HasEditLink, NavigationSourceConfiguration.HasReadLink ) and navigation link ( NavigationSourceConfiguration.HasNavigationPropertyLink, NavigationSourceConfiguration.HasNavigationPropertiesLink ) builders and can be used by the link builders to generate links.

public class ResourceContext
type ResourceContext = class
Public Class ResourceContext
Inheritance
ResourceContext
Derived

Constructors

ResourceContext()

Initializes a new instance of the ResourceContext class.

ResourceContext(ODataSerializerContext, IEdmStructuredTypeReference, Object)

Initializes a new instance of the ResourceContext class.

Properties

DynamicComplexProperties

Gets or sets the dynamic complex or collection of complex properties should be nested in this instance.

EdmModel

Gets or sets the IEdmModel to which this instance belongs.

EdmObject

Gets or sets the IEdmStructuredObject backing this instance.

NavigationSource

Gets or sets the IEdmNavigationSource to which this instance belongs.

Request

Gets or sets the HTTP request that caused this instance to be generated.

ResourceInstance

Gets or sets the value of this resource instance.

SerializerContext

Gets or sets the ODataSerializerContext.

SkipExpensiveAvailabilityChecks

Gets or sets a value indicating whether ActionAvailabilityChecks should be performed or not.

StructuredType

Gets or sets the IEdmStructuredType of this resource instance.

Url

Gets or sets a System.Web.Http.Routing.UrlHelper that may be used to generate links while serializing this resource instance.

Methods

GetPropertyValue(String)

Gets the value of the property with the given name from the IEdmObject of this instance if present; throws if the property is not present.

Extension Methods

GenerateActionLink(ResourceContext, IEdmOperation)

Generates an action link following the OData URL conventions for the action action and bound to the entity represented by resourceContext.

GenerateFunctionLink(ResourceContext, IEdmOperation)

Generates an function link following the OData URL conventions for the function function and bound to the entity represented by resourceContext.

GenerateNavigationPropertyLink(ResourceContext, IEdmNavigationProperty, Boolean)

Generates a navigation link following the OData URL conventions for the entity represented by resourceContext and the given navigation property.

GenerateSelfLink(ResourceContext, Boolean)

Generates a self link following the OData URL conventions for the entity represented by resourceContext.

Applies to