Share via


EntitySetConfiguration<TEntityType>.HasManyBinding<TTargetType, TDerivedEntityType> Method (Expression<Func<TDerivedEntityType, IEnumerable<TTargetType>>>, EntitySetConfiguration<TTargetType>)

Configures a many 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 HasManyBinding(Of TTargetType As Class, TDerivedEntityType As {Class, TEntityType}) ( _
    navigationExpression As Expression(Of Func(Of TDerivedEntityType, IEnumerable(Of TTargetType))), _
    targetSet As EntitySetConfiguration(Of TTargetType) _
) As NavigationPropertyBindingConfiguration
'Usage
Dim instance As EntitySetConfiguration 
Dim navigationExpression As Expression(Of Func(Of TDerivedEntityType, IEnumerable(Of TTargetType)))
Dim targetSet As EntitySetConfiguration(Of TTargetType)
Dim returnValue As NavigationPropertyBindingConfiguration 

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

Type Parameters

  • TTargetType
    The target entity set type.
  • TDerivedEntityType
    The target entity type.

Parameters

  • navigationExpression
    Type: System.Linq.Expressions.Expression<Func<TDerivedEntityType, IEnumerable<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

HasManyBinding Overload

System.Web.Http.OData.Builder Namespace