Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Things can go awry in many ways when you’re querying or updating entities. You might attempt to save entities to the database that are missing related data—a reservation without a trip, perhaps, or a reservation without a customer. The database might have a constraint that is not reflected in the model; if a user saves data that breaks the rule of the constraint, the database will throw an error. Or someone may have modified or even deleted a record while another user was editing it.
The Entity Framework includes a specialized set of exceptions for capturing problems like these that arise during query compilation and command execution.