DbExpressionBuilder.Navigate Method

 

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

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticNavigate(DbExpression, RelationshipEndMember, RelationshipEndMember)

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

System_CAPS_pubmethodSystem_CAPS_staticNavigate(RelationshipType, String, String, DbExpression)

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


DbExpressionBuilder.Navigate Method (DbExpression, RelationshipEndMember, RelationshipEndMember)

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

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

Parameters

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

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

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

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

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

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

Return Value

Type: System.Data.Entity.Core.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 NavigateForm 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 sonavigateFrommust always have a reference result type.


DbExpressionBuilder.Navigate Method (RelationshipType, String, String, DbExpression)

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

public static DbRelationshipNavigationExpression Navigate(
	this RelationshipType type,
	string fromEndName,
	string toEndName,
	DbExpression navigateFrom
)

Parameters

type
Type: System.Data.Entity.Core.Metadata.Edm.RelationshipType

Metadata for the relation type that represents the relationship.

fromEndName
Type: System.String

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

toEndName
Type: System.String

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

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

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

Return Value

Type: System.Data.Entity.Core.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

typefromEndName, toEndName or NavigateForm is null.

ArgumentException

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 fromEndName.

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