ManyNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithRequired Method

 

Configures the relationship to be many:required without a navigation property on the other side of the relationship.

Namespace:   System.Data.Entity.ModelConfiguration.Configuration
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodWithRequired()

Configures the relationship to be many:required without a navigation property on the other side of the relationship.

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

Configures the relationship to be many:required with a navigation property on the other side of the relationship.


ManyNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithRequired Method ()

Configures the relationship to be many:required without a navigation property on the other side of the relationship.

public DependentNavigationPropertyConfiguration<TTargetEntityType> WithRequired()

Return Value

Type: System.Data.Entity.ModelConfiguration.Configuration.DependentNavigationPropertyConfiguration<TTargetEntityType>

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


ManyNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithRequired Method (Expression<Func<TTargetEntityType, TEntityType>>)

Configures the relationship to be many:required with a navigation property on the other side of the relationship.

[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public DependentNavigationPropertyConfiguration<TTargetEntityType> WithRequired(
	Expression<Func<TTargetEntityType, TEntityType>> navigationPropertyExpression
)

Parameters

navigationPropertyExpression
Type: System.Linq.Expressions.Expression<Func<TTargetEntityType, TEntityType>>

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

Return Value

Type: System.Data.Entity.ModelConfiguration.Configuration.DependentNavigationPropertyConfiguration<TTargetEntityType>

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