ComplexObject Class


Base class for complex types.

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


[<DataContractAttribute(IsReference = true)>]
type ComplexObject = 
        inherit StructuralObject


Creates an instance of ComplexObject.


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodGetValidValue<'T>('T, String, Boolean, Boolean)

Returns a complex type for the specified property.(Inherited from StructuralObject.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Raises the PropertyChanged event.(Inherited from StructuralObject.)


Raises the PropertyChanging event.(Inherited from StructuralObject.)


Notifies the change tracker that a property of a complex object has changed.(Overrides StructuralObject.ReportPropertyChanged(String).)


Notifies the change tracker that a property change is pending on a complex object.(Overrides StructuralObject.ReportPropertyChanging(String).)

System_CAPS_protmethodSetValidValue<'T>('T, 'T, String)

Sets a complex object for the specified property.(Inherited from StructuralObject.)


Returns a string that represents the current object.(Inherited from Object.)


Occurs when a property value has changed.(Inherited from StructuralObject.)


Occurs when a property value change is a pending.(Inherited from StructuralObject.)

ComplexObject implements the basic functionality for complex types. For more information, see Complex Type Objects.

When implementing custom data classes with a conceptual model, we recommend that your data classes that represent complex types inherit from ComplexObject. For more information, see Customizing Objects.

A complex type can be a property of an entity type or of another complex type.

Complex types are returned by non-scalar properties of entity types. This enables scalar properties to be organized within entities. Like entities, complex types consist of scalar properties or other complex type properties. A complex type cannot be used without an associated entity type. Because complex types do not have keys, complex type objects cannot be managed without an associated entity type. For more information, see Complex Type Objects.

In the following example, the custom data class OrderInfo inherits from ComplexObject and is mapped to the OrderInfo complex type defined in the conceptual model.

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

.NET Framework
Available since 3.5

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

System.Data.Objects.DataClasses Namespace
How to: Define a Model with Complex Types (Entity Framework)
How to: Execute a Query that Returns Complex Types
How to: Add and Modify Objects with Complex Types (Entity Framework)

Return to top