DbExpressionBuilder.Navigate Method (DbExpression, RelationshipEndMember, RelationshipEndMember)

.NET Framework (current version)
 

Creates a new DbRelationshipNavigationExpression representing the navigation of a composition or association relationship.

Namespace:   System.Data.Common.CommandTrees.ExpressionBuilder
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public static DbRelationshipNavigationExpression Navigate(
	this DbExpression navigateFrom,
	RelationshipEndMember fromEnd,
	RelationshipEndMember toEnd
)

Parameters

navigateFrom
Type: System.Data.Common.CommandTrees.DbExpression

An expression that specifies the instance from which navigation should occur.

fromEnd
Type: System.Data.Metadata.Edm.RelationshipEndMember

Metadata for the property that represents the end of the relationship from which navigation should occur.

toEnd
Type: System.Data.Metadata.Edm.RelationshipEndMember

Metadata for the property that represents the end of the relationship to which navigation should occur.

Return Value

Type: System.Data.Common.CommandTrees.DbRelationshipNavigationExpression

A new DbRelationshipNavigationExpression representing the navigation of the specified from and to relation ends of the specified relation type from the specified navigation source instance.

Exception Condition
ArgumentNullException

fromEnd, toEnd or navigateFrom is null.

ArgumentException

fromEnd and toEnd are not declared by the same relationship type, or navigateFrom has a result type that is not compatible with the property type of fromEnd.

DbRelationshipNavigationExpression requires that navigation always occur from a reference, and so navigateFrom must always have a reference result type.

.NET Framework
Available since 4.5
Return to top
Show: