Share via


EntitySetConfiguration<TEntityType>.HasRequiredBinding<TTargetType> Method (Expression<Func<TEntityType, TTargetType>>, EntitySetConfiguration<TTargetType>)

Configures a required relationship from this entity type and binds the corresponding navigation property to the given entity set.

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

Syntax

'Declaration
Public Function HasRequiredBinding(Of TTargetType As Class) ( _
    navigationExpression As Expression(Of Func(Of TEntityType, TTargetType)), _
    targetSet As EntitySetConfiguration(Of TTargetType) _
) As NavigationPropertyBindingConfiguration
'Usage
Dim instance As EntitySetConfiguration 
Dim navigationExpression As Expression(Of Func(Of TEntityType, TTargetType))
Dim targetSet As EntitySetConfiguration(Of TTargetType)
Dim returnValue As NavigationPropertyBindingConfiguration 

returnValue = instance.HasRequiredBinding(navigationExpression, _
    targetSet)
public NavigationPropertyBindingConfiguration HasRequiredBinding<TTargetType>(
    Expression<Func<TEntityType, TTargetType>> navigationExpression,
    EntitySetConfiguration<TTargetType> targetSet
)
where TTargetType : class
public:
generic<typename TTargetType>
where TTargetType : ref class 
NavigationPropertyBindingConfiguration^ HasRequiredBinding(
    Expression<Func<TEntityType, TTargetType>^>^ navigationExpression, 
    EntitySetConfiguration<TTargetType>^ targetSet
)
member HasRequiredBinding : 
        navigationExpression:Expression<Func<'TEntityType, 'TTargetType>> * 
        targetSet:EntitySetConfiguration<'TTargetType> -> NavigationPropertyBindingConfiguration   when 'TTargetType : not struct
JScript does not support generic types and methods.

Type Parameters

  • TTargetType
    The target entity set type.

Parameters

  • navigationExpression
    Type: System.Linq.Expressions.Expression<Func<TEntityType, TTargetType>>
    A lambda expression representing the navigation property for the relationship.For example, in C# t =&gt; t.MyProperty and in Visual Basic .NET Function(t) t.MyProperty.

Return Value

Type: System.Web.Http.OData.Builder.NavigationPropertyBindingConfiguration
A configuration object that can be used to further configure the relationship.

See Also

Reference

EntitySetConfiguration<TEntityType> Class

HasRequiredBinding Overload

System.Web.Http.OData.Builder Namespace