Share via


MetadataWorkspaceExtensions.GetRootOrSelf Method

Returns the entity type at the root of an inheritance hierarchy.

Namespace:  Microsoft.Data.Entity.Design.DatabaseGeneration
Assembly:  Microsoft.Data.Entity.Design.DatabaseGeneration (in Microsoft.Data.Entity.Design.DatabaseGeneration.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function GetRootOrSelf ( _
    entityType As EntityType _
) As EntityType
'Usage
Dim entityType As EntityType
Dim returnValue As EntityType

returnValue = entityType.GetRootOrSelf()
public static EntityType GetRootOrSelf(
    this EntityType entityType
)
[ExtensionAttribute]
public:
static EntityType^ GetRootOrSelf(
    EntityType^ entityType
)
public static function GetRootOrSelf(
    entityType : EntityType
) : EntityType

Parameters

Return Value

Type: System.Data.Metadata.Edm.EntityType
The entity type at the root of an inheritance hierarchy.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type EntityType. 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).

Remarks

The GetRootOrSelf() method returns the specified entity type if it has no base type. Otherwise, this method returns the entity type at the root of the inheritance hierarchy of which the specified entity type is a derived type.

The GetRootOrSelf() method is used by the Generate Database Wizard when generating a database from a conceptual model.

Permissions

See Also

Reference

MetadataWorkspaceExtensions Class

MetadataWorkspaceExtensions Members

Microsoft.Data.Entity.Design.DatabaseGeneration Namespace

Other Resources

How to: Generate a Database from a Conceptual Model (Entity Data Model Tools)

Windows Workflow Foundation