DbExpressionBuilder.Navigate Method

Definition

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

Overloads

Navigate(DbExpression, RelationshipEndMember, RelationshipEndMember)

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

Navigate(RelationshipType, String, String, DbExpression)

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

Navigate(DbExpression, RelationshipEndMember, RelationshipEndMember)

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

C#
public static System.Data.Common.CommandTrees.DbRelationshipNavigationExpression Navigate(this System.Data.Common.CommandTrees.DbExpression navigateFrom, System.Data.Metadata.Edm.RelationshipEndMember fromEnd, System.Data.Metadata.Edm.RelationshipEndMember toEnd);

Parameters

navigateFrom
DbExpression

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

fromEnd
RelationshipEndMember

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

toEnd
RelationshipEndMember

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

Returns

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.

Exceptions

fromEnd, toEnd or navigateFrom is null.

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.

Remarks

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

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Navigate(RelationshipType, String, String, DbExpression)

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

C#
public static System.Data.Common.CommandTrees.DbRelationshipNavigationExpression Navigate(this System.Data.Metadata.Edm.RelationshipType type, string fromEndName, string toEndName, System.Data.Common.CommandTrees.DbExpression navigateFrom);

Parameters

type
RelationshipType

Metadata for the relation type that represents the relationship.

fromEndName
String

The name of the property of the relation type that represents the end of the relationship from which navigation should occur.

toEndName
String

The name of the property of the relation type that represents the end of the relationship to which navigation should occur.

navigateFrom
DbExpression

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

Returns

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.

Exceptions

type, fromEndName, toEndName or navigateFrom is null.

type is not associated with this command tree's metadata workspace or navigateFrom is associated with a different command tree, or type does not declare a relation end property with name toEndName or fromEndName, or navigateFrom has a result type that is not compatible with the property type of the relation end property with name fromEndName.

Remarks

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

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1