Database Reference
In-Depth Information
This model contains a single Invoice entity. We want to derive a new entity that represents deleted invoices.
This will allow us to separate more cleanly business logic that operates on active invoices differently than on deleted
invoices. To add the derived entity, do the following:
1.
View the Mapping Details window for the Invoice entity. Add a condition on the IsDeleted
column to map the entity when the column is 0, as shown in Figure 6-21 .
Figure 6-21. Mapping the Invoice entity when the IsDeleted column is 0
2.
Now that the IsDeleted column is used in a condition, we need to remove it from the scalar
properties for the entity. Right-click the IsDeleted property in the entity and select Delete.
3.
Right-click the design surface, and select Add Entity. Name the new entity
DeletedInvoice, and select Invoice as the base type.
4.
View the Mapping Details window for the DeletedInvoice entity. Map the entity to the
Invoice table. Add a condition on the IsDeleted column to map the entity when the
column is 1, as shown in Figure 6-22 .
Search WWH ::




Custom Search