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

.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 RelationshipType type,
	string fromEndName,
	string toEndName,
	DbExpression navigateFrom
)

Parameters

type
Type: System.Data.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.Common.CommandTrees.DbExpression

An expression the specifies the instance from which naviagtion 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

type, fromEndName, toEndName or navigateFrom 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 property type of the relation end property with name fromEndName.

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: