We are updating the DevExpress product documentation website and this page is part of our new experience. During this transition period, product documentation remains available in our previous format at documentation.devexpress.com. Learn More...

Shared Parts

When a Domain Component Interface is aggregated by several Domain Components registered as entities in the application, this interface must be registered via the ITypesInfo.RegisterSharedPart method. Registering Shared Parts leads to changes in the database schema (extra tables are created). That is why Shared Parts should be registered manually, rather then automatically.

These restrictions are required to avoid possible collisions between the primary key values of shared parts used in different entities. If you are registering an entity that does not aggregate shared parts, these restrictions do not apply, and you can use any kind of base class (such as classes with integer key properties). Note that the DCBaseObject base class used by the ITypesInfo.RegisterEntity method overloads, without the baseClass parameter, conforms to all the listed requirements. Thus, unless you need to use a custom base class, you do not need to be concerned about the limitations described here when registering your entities.

The IsExactTypeFunction does not operate with types that are shared parts. As a workaround, you can add an auxiliary property that returns the name of the shared part's type, and use it in the criteria.

Upcasting is not supported for Domain Components that are registered as shared parts.