ManyNavigationPropertyConfiguration<TEntityType,TTargetEntityType>.WithMany 方法

定义

重载

WithMany()

将关系配置为 many:many,且在关系的另一端无导航属性。

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

将关系配置为 many:many,且在关系的另一端有导航属性。

WithMany()

将关系配置为 many:many,且在关系的另一端无导航属性。

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

返回

一个配置对象,可用于进一步配置关系。

适用于

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

将关系配置为 many:many,且在关系的另一端有导航属性。

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

参数

navigationPropertyExpression
Expression<Func<TTargetEntityType,ICollection<TEntityType>>>

一个 lambda 表达式,表示关系另一端的导航属性。 C#:t => t.MyProperty
VB.Net:函数 (t) t.MyProperty

返回

一个配置对象,可用于进一步配置关系。

属性

适用于