Export (0) Print
Expand All

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

.NET Framework 4.5

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.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type RelationshipType. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

ExceptionCondition
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

Supported in: 4.5.2, 4.5.1, 4.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft