OptionalNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithMany Method

 

Configures the relationship to be optional:many.

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

NameDescription
System_CAPS_pubmethodWithMany()

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

System_CAPS_pubmethodWithMany(Expression<Func<TTargetEntityType, ICollection<TEntityType>>>)

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


OptionalNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithMany Method ()

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

public DependentNavigationPropertyConfiguration<TEntityType> WithMany()

Return Value

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

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


OptionalNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithMany Method (Expression<Func<TTargetEntityType, ICollection<TEntityType>>>)

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

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

Parameters

navigationPropertyExpression
Type: System.Linq.Expressions.Expression<Func<TTargetEntityType, ICollection<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<TEntityType>

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