0
votes

I've used Entity Framework 4.0 POCO entities for persistence layer in the current project.

I've used DTO's to send the data from Service Layer to UI Layer. Repositories and inside of Service Layer have used POCO.

There is a Mapping Layer to map (DTO to Domain(POCO) and (Domain(POCO) to DTO). At the moment, we manually track the changes.

For example, If entity id is zero we assume that entity is a new one and if not entity is an update.

Is there any way to achieve this other than implementing IsTransient(New), IsDirty(Update) or IsDeleted(Delete) properties manually in Entity Framework 4.0?

1

1 Answers

2
votes

If you use your custom DTO you must always implement your own change tracking.

EF 4 offers only self tracking entities but that would require you to use these entities directly instead of DTOs and they have some other disadvantages.