OptionalNavigationPropertyConfiguration<TEntityType,TTargetEntityType>.WithOptionalDependent 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.
Overloads
WithOptionalDependent() |
Configures the relationship to be optional:optional 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. |
WithOptionalDependent(Expression<Func<TTargetEntityType,TEntityType>>) |
Configures the relationship to be optional:optional 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. |
WithOptionalDependent()
Configures the relationship to be optional:optional 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.
public System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration WithOptionalDependent ();
member this.WithOptionalDependent : unit -> System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration
Public Function WithOptionalDependent () As ForeignKeyNavigationPropertyConfiguration
Returns
A configuration object that can be used to further configure the relationship.
Applies to
WithOptionalDependent(Expression<Func<TTargetEntityType,TEntityType>>)
Configures the relationship to be optional:optional 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.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration WithOptionalDependent (System.Linq.Expressions.Expression<Func<TTargetEntityType,TEntityType>> navigationPropertyExpression);
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration WithOptionalDependent (System.Linq.Expressions.Expression<Func<TTargetEntityType,TEntityType>> navigationPropertyExpression);
member this.WithOptionalDependent : System.Linq.Expressions.Expression<Func<'argetEntityType, 'EntityType>> -> System.Data.Entity.ModelConfiguration.Configuration.ForeignKeyNavigationPropertyConfiguration
Public Function WithOptionalDependent (navigationPropertyExpression As Expression(Of Func(Of TTargetEntityType, TEntityType))) As ForeignKeyNavigationPropertyConfiguration
Parameters
- navigationPropertyExpression
- 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
Returns
A configuration object that can be used to further configure the relationship.
- Attributes
Applies to
Entity Framework