EntitySetConfiguration<TEntityType>.HasOptionalBinding Method
Namespace: System.Web.Http.OData.Builder
Assembly: System.Web.Http.OData (in System.Web.Http.OData.dll)
Overload List
Name | Description | |
---|---|---|
HasOptionalBinding<TTargetType>(Expression<Func<TEntityType, TTargetType>>, EntitySetConfiguration<TTargetType>) | Configures an optional relationship from this entity type and binds the corresponding navigation property to the given entity set. |
|
HasOptionalBinding<TTargetType>(Expression<Func<TEntityType, TTargetType>>, String) | Configures an optional relationship from this entity type and binds the corresponding navigation property to the given entity set. |
|
HasOptionalBinding<TTargetType, TDerivedEntityType>(Expression<Func<TDerivedEntityType, TTargetType>>, EntitySetConfiguration<TTargetType>) | Configures an optional relationship from this entity type and binds the corresponding navigation property to the given entity set. |
|
HasOptionalBinding<TTargetType, TDerivedEntityType>(Expression<Func<TDerivedEntityType, TTargetType>>, String) | Configures an optional relationship from this entity type and binds the corresponding navigation property to the given entity set. |
See Also
EntitySetConfiguration<TEntityType> Class
System.Web.Http.OData.Builder Namespace
Return to top
EntitySetConfiguration<TEntityType>.HasOptionalBinding<TTargetType> Method (Expression<Func<TEntityType, TTargetType>>, EntitySetConfiguration<TTargetType>)
Configures an optional relationship from this entity type and binds the corresponding navigation property to the given entity set.
Syntax
public NavigationPropertyBindingConfiguration HasOptionalBinding<TTargetType>(
Expression<Func<TEntityType, TTargetType>> navigationExpression,
EntitySetConfiguration<TTargetType> targetSet
)
where TTargetType : class
public:
generic<typename TTargetType>
where TTargetType : ref class
NavigationPropertyBindingConfiguration^ HasOptionalBinding(
Expression<Func<TEntityType, TTargetType>^>^ navigationExpression,
EntitySetConfiguration<TTargetType>^ targetSet
)
member HasOptionalBinding<'TTargetType when 'TTargetType : not struct> :
navigationExpression:Expression<Func<'TEntityType, 'TTargetType>> *
targetSet:EntitySetConfiguration<'TTargetType> -> NavigationPropertyBindingConfiguration
Public Function HasOptionalBinding(Of TTargetType As Class) (
navigationExpression As Expression(Of Func(Of TEntityType, TTargetType)),
targetSet As EntitySetConfiguration(Of TTargetType)
) As NavigationPropertyBindingConfiguration
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 => t.MyProperty and in Visual Basic .NET Function(t) t.MyProperty.
targetSet
Type: System.Web.Http.OData.Builder.EntitySetConfiguration<TTargetType>The target entity set for the binding.
Return Value
Type: System.Web.Http.OData.Builder.NavigationPropertyBindingConfiguration
A configuration object that can be used to further configure the relationship further.
Type Parameters
- TTargetType
The target entity set type.
Return to top
EntitySetConfiguration<TEntityType>.HasOptionalBinding<TTargetType> Method (Expression<Func<TEntityType, TTargetType>>, String)
Configures an optional relationship from this entity type and binds the corresponding navigation property to the given entity set.
Syntax
public NavigationPropertyBindingConfiguration HasOptionalBinding<TTargetType>(
Expression<Func<TEntityType, TTargetType>> navigationExpression,
string entitySetName
)
where TTargetType : class
public:
generic<typename TTargetType>
where TTargetType : ref class
NavigationPropertyBindingConfiguration^ HasOptionalBinding(
Expression<Func<TEntityType, TTargetType>^>^ navigationExpression,
String^ entitySetName
)
member HasOptionalBinding<'TTargetType when 'TTargetType : not struct> :
navigationExpression:Expression<Func<'TEntityType, 'TTargetType>> *
entitySetName:string -> NavigationPropertyBindingConfiguration
Public Function HasOptionalBinding(Of TTargetType As Class) (
navigationExpression As Expression(Of Func(Of TEntityType, TTargetType)),
entitySetName As String
) As NavigationPropertyBindingConfiguration
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 => t.MyProperty and in Visual Basic .NET Function(t) t.MyProperty.
entitySetName
Type: System.StringThe target entity set name for the binding.
Return Value
Type: System.Web.Http.OData.Builder.NavigationPropertyBindingConfiguration
A configuration object that can be used to further configure the relationship further.
Type Parameters
- TTargetType
The target entity set type.
Return to top
EntitySetConfiguration<TEntityType>.HasOptionalBinding<TTargetType, TDerivedEntityType> Method (Expression<Func<TDerivedEntityType, TTargetType>>, EntitySetConfiguration<TTargetType>)
Configures an optional relationship from this entity type and binds the corresponding navigation property to the given entity set.
Syntax
public NavigationPropertyBindingConfiguration HasOptionalBinding<TTargetType, TDerivedEntityType>(
Expression<Func<TDerivedEntityType, 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^ HasOptionalBinding(
Expression<Func<TDerivedEntityType, TTargetType>^>^ navigationExpression,
EntitySetConfiguration<TTargetType>^ targetSet
)
member HasOptionalBinding<'TTargetType, 'TDerivedEntityType when 'TTargetType : not struct when 'TDerivedEntityType : not struct and 'TEntityType> :
navigationExpression:Expression<Func<'TDerivedEntityType, 'TTargetType>> *
targetSet:EntitySetConfiguration<'TTargetType> -> NavigationPropertyBindingConfiguration
Public Function HasOptionalBinding(Of TTargetType As Class, TDerivedEntityType As { Class, TEntityType }) (
navigationExpression As Expression(Of Func(Of TDerivedEntityType, TTargetType)),
targetSet As EntitySetConfiguration(Of TTargetType)
) As NavigationPropertyBindingConfiguration
Parameters
navigationExpression
Type: System.Linq.Expressions.Expression<Func<TDerivedEntityType, TTargetType>>A lambda expression representing the navigation property for the relationship. For example, in C# t => t.MyProperty and in Visual Basic .NET Function(t) t.MyProperty.
targetSet
Type: System.Web.Http.OData.Builder.EntitySetConfiguration<TTargetType>The target entity set for the binding.
Return Value
Type: System.Web.Http.OData.Builder.NavigationPropertyBindingConfiguration
A configuration object that can be used to further configure the relationship further.
Type Parameters
- TTargetType
The target entity set type.
- TDerivedEntityType
The target entity type.
Return to top
EntitySetConfiguration<TEntityType>.HasOptionalBinding<TTargetType, TDerivedEntityType> Method (Expression<Func<TDerivedEntityType, TTargetType>>, String)
Configures an optional relationship from this entity type and binds the corresponding navigation property to the given entity set.
Syntax
public NavigationPropertyBindingConfiguration HasOptionalBinding<TTargetType, TDerivedEntityType>(
Expression<Func<TDerivedEntityType, TTargetType>> navigationExpression,
string entitySetName
)
where TTargetType : class
where TDerivedEntityType : class, TEntityType
public:
generic<typename TTargetType, typename TDerivedEntityType>
where TTargetType : ref class
where TDerivedEntityType : ref class, TEntityType
NavigationPropertyBindingConfiguration^ HasOptionalBinding(
Expression<Func<TDerivedEntityType, TTargetType>^>^ navigationExpression,
String^ entitySetName
)
member HasOptionalBinding<'TTargetType, 'TDerivedEntityType when 'TTargetType : not struct when 'TDerivedEntityType : not struct and 'TEntityType> :
navigationExpression:Expression<Func<'TDerivedEntityType, 'TTargetType>> *
entitySetName:string -> NavigationPropertyBindingConfiguration
Public Function HasOptionalBinding(Of TTargetType As Class, TDerivedEntityType As { Class, TEntityType }) (
navigationExpression As Expression(Of Func(Of TDerivedEntityType, TTargetType)),
entitySetName As String
) As NavigationPropertyBindingConfiguration
Parameters
navigationExpression
Type: System.Linq.Expressions.Expression<Func<TDerivedEntityType, TTargetType>>A lambda expression representing the navigation property for the relationship. For example, in C# t => t.MyProperty and in Visual Basic .NET Function(t) t.MyProperty.
entitySetName
Type: System.StringThe target entity set name for the binding. It will be created if it does not exist.
Return Value
Type: System.Web.Http.OData.Builder.NavigationPropertyBindingConfiguration
A configuration object that can be used to further configure the relationship further.
Type Parameters
- TTargetType
The target entity set type.
- TDerivedEntityType
The target entity type.
Return to top