ManyNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithOptional Method

 

Configures the relationship to be many:optional 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_pubmethodWithOptional()

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

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

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


ManyNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithOptional Method ()

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

public DependentNavigationPropertyConfiguration<TTargetEntityType> WithOptional()

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>.WithOptional Method (Expression<Func<TTargetEntityType, TEntityType>>)

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

[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public DependentNavigationPropertyConfiguration<TTargetEntityType> WithOptional(
	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.