Skip to main content
A newer version of this page is available.
All docs
V18.2

Data Annotations in DC

  • 2 minutes to read

Important

Domain Component (DC) interfaces are abstractions above eXpress Persistent Objects (XPO) classes. Notwithstanding its benefits, this abstraction imposes certain technical limitations. DC is only suitable for certain usage scenarios. The Blazor User Interface is not supported for DC. DC is in maintenance mode and we do not recommend its use in new software projects. We recommend that you migrate DC interfaces to pure XPO classes.

This topic provides a list of extra attributes that can be used with Domain Components, in addition to the built-in XAF attributes and XPO attributes from the DevExpress.Xpo namespace.

Attribute

Description

BackReferencePropertyAttribute

Applied to Domain Component properties participating in a relationship. The attribute’s only parameter specifies the name of the related property in another Domain Component. To see an example of how this attribute is used, refer to the One-to-Many and Many-to-Many Relationships topic.

CreateInstanceAttribute

Applied to methods. Specifies that a Domain Component’s target method will create Domain Component instances.

DomainComponentAttribute

Applied to classes and interfaces. When applied to an interface, specifies that the interface represents a Domain Component.

DomainLogicAttribute

Applied to classes. Specifies that a target class represents a Domain Logic.

NonPersistentDcAttribute

Applied to Domain Components and their properties. When applied to a property, specifies that the property will not be persisted to the datastore. When NonPersistentDcAttribute is applied to a Domain Component, it specifies that a separate table will not be created in the datastore for the Domain Component. Instead, data associated with the Domain Component will be persisted directly within the tables of Domain Components aggregating this Domain Component. Note that a Domain Component decorated with NonPersistentDcAttribute cannot be registered by the ITypesInfo.RegisterEntity and ITypesInfo.RegisterSharedPart methods. Consequently, you will not be able to perform queries for the Domain Component type (e.g., create an XPCollection or display a List View for the type).

PersistentDcAttribute

Applied to Domain Component properties. Functions exactly like the PersistentAttribute applied to a regular business class property.