This documentation is archived and is not being maintained.

IEntityWithRelationships Interface

Defines an entity type with a relationship to one or more other entity type.

Namespace:  System.Data.Objects.DataClasses
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

public interface class IEntityWithRelationships

IEntityWithRelationships defines the features that must be implemented by an entity type that has relationships to other types. Relationships are defined as associations in the Entity Data Model.

EntityObject is the base class for all entity types generated by the Entity Data Model tools. The EntityObject class implements IEntityWithRelationships.

To use custom data classes together with an Entity Data Model (EDM), you must either inherit from EntityObject or implement a set of interfaces. When you implement custom data class interfaces, you must implement IEntityWithRelationships when the entity type is related to other types. For information about how to customize your objects, see Implementing an Entity Data Model with Custom Objects (Entity Framework).

The example in this topic is based on the Adventure Works Sales Model. The example implements the IEntityWithRelationships interface in the Order type.

No code example is currently available or this language may not be supported.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5 SP1