RequiredNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithRequiredDependent Method
Configures the relationship to be required:required without a navigation property on the other side of the relationship.
Assembly: EntityFramework (in EntityFramework.dll)
Name | Description | |
---|---|---|
![]() | WithRequiredDependent() | Configures the relationship to be required:required without a navigation property on the other side of the relationship. The entity type being configured will be the dependent and contain a foreign key to the principal. The entity type that the relationship targets will be the principal in the relationship. |
![]() | WithRequiredDependent(Expression<Func<TTargetEntityType, TEntityType>>) | Configures the relationship to be required:required with a navigation property on the other side of the relationship. The entity type being configured will be the dependent and contain a foreign key to the principal. The entity type that the relationship targets will be the principal in the relationship. |
RequiredNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithRequiredDependent Method ()
Configures the relationship to be required:required without a navigation property on the other side of the relationship. The entity type being configured will be the dependent and contain a foreign key to the principal. The entity type that the relationship targets will be the principal in the relationship.
Return Value
Type: System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfigurationA configuration object that can be used to further configure the relationship.
RequiredNavigationPropertyConfiguration<TEntityType, TTargetEntityType>.WithRequiredDependent Method (Expression<Func<TTargetEntityType, TEntityType>>)
Configures the relationship to be required:required with a navigation property on the other side of the relationship. The entity type being configured will be the dependent and contain a foreign key to the principal. The entity type that the relationship targets will be the principal in the relationship.
[SuppressMessageAttribute("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")] [SuppressMessageAttribute("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")] public ForeignKeyNavigationPropertyConfiguration WithRequiredDependent( 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 => t.MyProperty VB.Net: Function(t) t.MyProperty
Return Value
Type: System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfigurationA configuration object that can be used to further configure the relationship.