Compartilhar via


EntityTypeConfiguration<TEntityType>.HasMany<TTargetEntity> Método

Definição

Configura um relacionamento de muitos neste tipo de entidade.

[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public System.Data.Entity.ModelConfiguration.Configuration.ManyNavigationPropertyConfiguration<TEntityType,TTargetEntity> HasMany<TTargetEntity> (System.Linq.Expressions.Expression<Func<TEntityType,System.Collections.Generic.ICollection<TTargetEntity>>> navigationPropertyExpression) where TTargetEntity : class;
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
public System.Data.Entity.ModelConfiguration.Configuration.ManyNavigationPropertyConfiguration<TEntityType,TTargetEntity> HasMany<TTargetEntity> (System.Linq.Expressions.Expression<Func<TEntityType,System.Collections.Generic.ICollection<TTargetEntity>>> navigationPropertyExpression) where TTargetEntity : class;
member this.HasMany : System.Linq.Expressions.Expression<Func<'EntityType, System.Collections.Generic.ICollection<'argetEntity>>> -> System.Data.Entity.ModelConfiguration.Configuration.ManyNavigationPropertyConfiguration<'EntityType, 'argetEntity (requires 'EntityType : null and 'argetEntity : null)> (requires 'argetEntity : null)
Public Function HasMany(Of TTargetEntity As Class) (navigationPropertyExpression As Expression(Of Func(Of TEntityType, ICollection(Of TTargetEntity)))) As ManyNavigationPropertyConfiguration(Of TEntityType, TTargetEntity)

Parâmetros de tipo

TTargetEntity

O tipo da entidade na outra extremidade do relacionamento.

Parâmetros

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

Uma expressão lambda que representa a propriedade de navegação para o relacionamento. C#: t => t.MyProperty VB.Net: Function(t) t.MyProperty

Retornos

ManyNavigationPropertyConfiguration<TEntityType,TTargetEntity>

Um objeto de configuração que pode ser usado para configurar melhor o relacionamento.

Atributos

Aplica-se a