Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 5.03 KB

Layer-Entity.md

File metadata and controls

57 lines (37 loc) · 5.03 KB

Entity (DTO)

The Entity (DTO) is primarily responsible for defining the domain-based model (and contract where accessible externally over-the-wire). They are also used to define the reference data model.

The aim here is decouple this definition, where applicable, from the underlying data source. This is likely to be defined differently, with an alternate naming convention, alternate shape/structure, etc. This also enables the data source to evolve independently of this model, as well as possibly hide additional implementaion details.

Beef looks to define two versions of the entity, the Common (external) and Business (internal) representations. This allows additional features to be leveraged internally that need not be exposed externally.


Capabilities

The key Beef entity capabilities are enabled primarily by the CoreEx.Entities and CoreEx.Entities.Extended namespaces.


Business (internal)

A code-generated Business (internal) entity will get the following capabilities:

Additional interfaces are automatically implemented where corresponding properties, etc. are specified:

The sample PerformanceReview entity demonstrates the richness of the generated output.


Common (external)

A code-generated Common (external) entity will get the following interfaces automatically implemented where corresponding properties, etc. are specified:

The sample PerformanceReview entity demonstrates the simpler alternative of the generated output.


Usage

The Entity and its corresponding Property elements within the entity.beef-5.yaml configuration primarily drives the output. There is a generated class per Entity with the same name.