EntityTypeConfiguration<TEntityType>.ContainsOptional<TTargetEntity> Method (Expression<Func<TEntityType, TTargetEntity>>)
Configures an optional relationship from this entity type to a single contained navigation property.
Namespace: System.Web.OData.Builder
Assembly: System.Web.OData (in System.Web.OData.dll)
Syntax
public NavigationPropertyConfiguration ContainsOptional<TTargetEntity>(
Expression<Func<TEntityType, TTargetEntity>> navigationPropertyExpression
)
where TTargetEntity : class
public:
generic<typename TTargetEntity>
where TTargetEntity : ref class
NavigationPropertyConfiguration^ ContainsOptional(
Expression<Func<TEntityType, TTargetEntity>^>^ navigationPropertyExpression
)
member ContainsOptional<'TTargetEntity when 'TTargetEntity : not struct> :
navigationPropertyExpression:Expression<Func<'TEntityType, 'TTargetEntity>> -> NavigationPropertyConfiguration
Public Function ContainsOptional(Of TTargetEntity As Class) (
navigationPropertyExpression As Expression(Of Func(Of TEntityType, TTargetEntity))
) As NavigationPropertyConfiguration
Parameters
navigationPropertyExpression
Type: System.Linq.Expressions.Expression<Func<TEntityType, TTargetEntity>>A lambda expression representing the navigation property for the relationship. For example, in C# t => t.MyProperty and in Visual Basic .NET Function(t) t.MyProperty.
Return Value
Type: System.Web.OData.Builder.NavigationPropertyConfiguration
A configuration object that can be used to further configure the relationship.
Type Parameters
- TTargetEntity
The type of the entity at the other end of the relationship.
See Also
EntityTypeConfiguration<TEntityType> Class
System.Web.OData.Builder Namespace
Return to top