StructuralTypeConfiguration<TStructuralType>.HasRequired 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
HasRequired<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>, Expression<Func<TTargetEntity, TStructuralType>>) |
Configures a required relationship with referential constraint from this structural type. |
HasRequired<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>, Expression<Func<TTargetEntity, IEnumerable<TStructuralType>>>) |
Configures a required relationship with referential constraint from this structural type. |
HasRequired<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>) |
Configures a required relationship from this structural type. |
HasRequired<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>) |
Configures a required relationship with referential constraint from this structural type. |
HasRequired<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>, Expression<Func<TTargetEntity, TStructuralType>>)
Configures a required relationship with referential constraint from this structural type.
public Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration HasRequired<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.HasRequired : 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 HasRequired(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>>
Returns
A configuration object that can be used to further configure the relationship.
Applies to
HasRequired<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>, Expression<Func<TTargetEntity, IEnumerable<TStructuralType>>>)
Configures a required relationship with referential constraint from this structural type.
public Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration HasRequired<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.HasRequired : 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 HasRequired(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
HasRequired<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>)
Configures a required relationship from this structural type.
public Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration HasRequired<TTargetEntity> (System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity>> navigationPropertyExpression) where TTargetEntity : class;
member this.HasRequired : System.Linq.Expressions.Expression<Func<'StructuralType, 'argetEntity>> -> Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration (requires 'argetEntity : null)
Public Function HasRequired(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
HasRequired<TTargetEntity>(Expression<Func<TStructuralType,TTargetEntity>>, Expression<Func<TStructuralType,TTargetEntity,Boolean>>)
Configures a required relationship with referential constraint from this structural type.
public Microsoft.AspNet.OData.Builder.NavigationPropertyConfiguration HasRequired<TTargetEntity> (System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity>> navigationPropertyExpression, System.Linq.Expressions.Expression<Func<TStructuralType,TTargetEntity,bool>> referentialConstraintExpression) where TTargetEntity : class;
member this.HasRequired : 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 HasRequired(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.