RequiredNavigationPropertyConfiguration<TEntityType,TTargetEntityType>.WithRequiredPrincipal RequiredNavigationPropertyConfiguration<TEntityType,TTargetEntityType>.WithRequiredPrincipal RequiredNavigationPropertyConfiguration<TEntityType,TTargetEntityType>.WithRequiredPrincipal Method

Definition

Overloads

WithRequiredPrincipal() WithRequiredPrincipal() WithRequiredPrincipal()

Configures the relationship to be required:required without a navigation property on the other side of the relationship. The entity type being configured will be the principal in the relationship. The entity type that the relationship targets will be the dependent and contain a foreign key to the principal.

WithRequiredPrincipal(Expression<Func<TTargetEntityType,TEntityType>>) WithRequiredPrincipal(Expression<Func<TTargetEntityType,TEntityType>>) WithRequiredPrincipal(Expression<Func<TTargetEntityType,TEntityType>>)

Configures the relationship to be required:required with a navigation property on the other side of the relationship. The entity type being configured will be the principal in the relationship. The entity type that the relationship targets will be the dependent and contain a foreign key to the principal.

WithRequiredPrincipal() WithRequiredPrincipal() WithRequiredPrincipal()

Configures the relationship to be required:required without a navigation property on the other side of the relationship. The entity type being configured will be the principal in the relationship. The entity type that the relationship targets will be the dependent and contain a foreign key to the principal.

public System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration WithRequiredPrincipal ();
member this.WithRequiredPrincipal : unit -> System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration
Public Function WithRequiredPrincipal () As ForeignKeyNavigationPropertyConfiguration

Returns

A configuration object that can be used to further configure the relationship.

WithRequiredPrincipal(Expression<Func<TTargetEntityType,TEntityType>>) WithRequiredPrincipal(Expression<Func<TTargetEntityType,TEntityType>>) WithRequiredPrincipal(Expression<Func<TTargetEntityType,TEntityType>>)

Configures the relationship to be required:required with a navigation property on the other side of the relationship. The entity type being configured will be the principal in the relationship. The entity type that the relationship targets will be the dependent and contain a foreign key to the principal.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration WithRequiredPrincipal (System.Linq.Expressions.Expression<Func<TTargetEntityType,TEntityType>> navigationPropertyExpression);
member this.WithRequiredPrincipal : System.Linq.Expressions.Expression<Func<'argetEntityType, 'EntityType>> -> System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration
Public Function WithRequiredPrincipal (navigationPropertyExpression As Expression(Of Func(Of TTargetEntityType, TEntityType))) As ForeignKeyNavigationPropertyConfiguration

Parameters

navigationPropertyExpression
Expression<Func<TTargetEntityType,TEntityType>>

An lambda expression representing the navigation property on the other end of the relationship. C#: t => t.MyProperty VB.Net: Function(t) t.MyProperty

Returns

A configuration object that can be used to further configure the relationship.

Applies to