StructuralTypeConfiguration<TStructuralType>.HasOptional Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
HasOptional<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>) |
Configures an optional relationship from this structural type. |
HasOptional<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>) |
Configures an optional relationship with referential constraint from this structural type. |
HasOptional<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>, Expression<Func<TTargetEntity, IEnumerable<TStructuralType>>>) |
Configures an optional relationship with referential constraint from this structural type. |
HasOptional<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>, Expression<Func<TTargetEntity, TStructuralType>>) |
Configures an optional relationship with referential constraint from this structural type. |
HasOptional<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>)
Configures an optional relationship from this structural type.
public Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration HasOptional<TTargetEntity> (System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity>> navigationPropertyExpression) where TTargetEntity : class;
member this.HasOptional : System.Linq.Expressions.Expression<Func<'StructuralType, 'argetEntity>> -> Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration (requires 'argetEntity : null)
Public Function HasOptional(Of TTargetEntity As Class) (navigationPropertyExpression As Expression(Of Func(Of TStructuralType, TTargetEntity))) As NavigationPropertyConfiguration
Type Parameters
- TTargetEntity
The type of the entity at the other end of the relationship.
Parameters
- navigationPropertyExpression
- Expression<Func<TStructuralType,TTargetEntity>>
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
.
Returns
A configuration object that can be used to further configure the relationship.
Applies to
HasOptional<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>)
Configures an optional relationship with referential constraint from this structural type.
public Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration HasOptional<TTargetEntity> (System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity>> navigationPropertyExpression, System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity,bool>> referentialConstraintExpression) where TTargetEntity : class;
member this.HasOptional : System.Linq.Expressions.Expression<Func<'StructuralType, 'argetEntity>> * System.Linq.Expressions.Expression<Func<'StructuralType, 'argetEntity, bool>> -> Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration (requires 'argetEntity : null)
Public Function HasOptional(Of TTargetEntity As Class) (navigationPropertyExpression As Expression(Of Func(Of TStructuralType, TTargetEntity)), referentialConstraintExpression As Expression(Of Func(Of TStructuralType, TTargetEntity, Boolean))) As NavigationPropertyConfiguration
Type Parameters
- TTargetEntity
The type of the entity at the other end of the relationship.
Parameters
- navigationPropertyExpression
- Expression<Func<TStructuralType,TTargetEntity>>
A lambda expression representing the navigation property for the relationship.
For example, in C# t => t.Customer
and in Visual Basic .NET Function(t) t.Customer
.
- referentialConstraintExpression
- Expression<Func<TStructuralType,TTargetEntity,Boolean>>
A lambda expression representing the referential constraint. For example,
in C# (o, c) => o.CustomerId == c.Id
and in Visual Basic .NET Function(o, c) c.CustomerId == c.Id
.
Returns
A configuration object that can be used to further configure the relationship.
Applies to
HasOptional<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>, Expression<Func<TTargetEntity, IEnumerable<TStructuralType>>>)
Configures an optional relationship with referential constraint from this structural type.
public Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration HasOptional<TTargetEntity> (System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity>> navigationPropertyExpression, System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity,bool>> referentialConstraintExpression, System.Linq.Expressions.Expression<Func<TTargetEntity,System.Collections.Generic.IEnumerable<TStructuralType>>> partnerExpression) where TTargetEntity : class;
member this.HasOptional : System.Linq.Expressions.Expression<Func<'StructuralType, 'argetEntity>> * System.Linq.Expressions.Expression<Func<'StructuralType, 'argetEntity, bool>> * System.Linq.Expressions.Expression<Func<'argetEntity, seq<'StructuralType>>> -> Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration (requires 'argetEntity : null)
Public Function HasOptional(Of TTargetEntity As Class) (navigationPropertyExpression As Expression(Of Func(Of TStructuralType, TTargetEntity)), referentialConstraintExpression As Expression(Of Func(Of TStructuralType, TTargetEntity, Boolean)), partnerExpression As Expression(Of Func(Of TTargetEntity, IEnumerable(Of TStructuralType)))) As NavigationPropertyConfiguration
Type Parameters
- TTargetEntity
The type of the entity at the other end of the relationship.
Parameters
- navigationPropertyExpression
- Expression<Func<TStructuralType,TTargetEntity>>
A lambda expression representing the navigation property for the relationship.
For example, in C# t => t.Customer
and in Visual Basic .NET Function(t) t.Customer
.
- referentialConstraintExpression
- Expression<Func<TStructuralType,TTargetEntity,Boolean>>
A lambda expression representing the referential constraint. For example,
in C# (o, c) => o.CustomerId == c.Id
and in Visual Basic .NET Function(o, c) c.CustomerId == c.Id
.
- partnerExpression
- Expression<Func<TTargetEntity,IEnumerable<TStructuralType>>>
The partner expression for this relationship.
Returns
A configuration object that can be used to further configure the relationship.
Applies to
HasOptional<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>, Expression<Func<TTargetEntity, TStructuralType>>)
Configures an optional relationship with referential constraint from this structural type.
public Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration HasOptional<TTargetEntity> (System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity>> navigationPropertyExpression, System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity,bool>> referentialConstraintExpression, System.Linq.Expressions.Expression<Func<TTargetEntity,TStructuralType>> partnerExpression) where TTargetEntity : class;
member this.HasOptional : System.Linq.Expressions.Expression<Func<'StructuralType, 'argetEntity>> * System.Linq.Expressions.Expression<Func<'StructuralType, 'argetEntity, bool>> * System.Linq.Expressions.Expression<Func<'argetEntity, 'StructuralType>> -> Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration (requires 'argetEntity : null)
Public Function HasOptional(Of TTargetEntity As Class) (navigationPropertyExpression As Expression(Of Func(Of TStructuralType, TTargetEntity)), referentialConstraintExpression As Expression(Of Func(Of TStructuralType, TTargetEntity, Boolean)), partnerExpression As Expression(Of Func(Of TTargetEntity, TStructuralType))) As NavigationPropertyConfiguration
Type Parameters
- TTargetEntity
The type of the entity at the other end of the relationship.
Parameters
- navigationPropertyExpression
- Expression<Func<TStructuralType,TTargetEntity>>
A lambda expression representing the navigation property for the relationship.
For example, in C# t => t.Customer
and in Visual Basic .NET Function(t) t.Customer
.
- referentialConstraintExpression
- Expression<Func<TStructuralType,TTargetEntity,Boolean>>
A lambda expression representing the referential constraint. For example,
in C# (o, c) => o.CustomerId == c.Id
and in Visual Basic .NET Function(o, c) c.CustomerId == c.Id
.
- partnerExpression
- Expression<Func<TTargetEntity,TStructuralType>>
The partner expression for this relationship.
Returns
A configuration object that can be used to further configure the relationship.