Entity Framework - Anti-Patterns To Avoid In N-Tier Applications
By Daniel Simmons | June 2009
This article discusses:
This article uses the following technologies:
- Query the entity and serialize it to the client. At this point, the concurrency token's current value is the same as the original value, and that is the only value sent to the client.
- The client receives the entity, makes changes, and sends a modified version of the entity back to the mid-tier.
- Since neither the client nor the service explicitly kept track of the concurrency token or what properties have been modified, the service queries the database to get the current state of the entity into a newly created context, then compares values between the current entity from the database and the one sent back from the client.
- The service calls SaveChanges, which performs optimistic concurrency checks while persisting the changes.