EntityTypeConfiguration<TEntityType>.HasMany<TTargetEntity> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Configures a many relationship from this entity type.
[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)
Type Parameters
- TTargetEntity
The type of the entity at the other end of the relationship.
Parameters
- navigationPropertyExpression
- Expression<Func<TEntityType,ICollection<TTargetEntity>>>
A lambda expression representing the navigation property for the relationship. C#: t => t.MyProperty VB.Net: Function(t) t.MyProperty
Returns
ManyNavigationPropertyConfiguration<TEntityType,TTargetEntity>
A configuration object that can be used to further configure the relationship.
- Attributes
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Entity Framework