10. Working with Entities

And so we come to the final subject of the book, and, arguably the whole purpose of Entity Framework: modifying data in your application, and persisting those modifications back to the database.

If you’re a database person, you’ll know these as CRUD operations. CRUD stands for Create, Read, Update and Delete. Of course, we’ve already explored the “R” in that acronym when we looked at the various ways that you can query an EDM. But I’ll still call them CRUD, because the alternative acronym is, well, just a wee bit too bovine.

In fact, CRUD operations are trivially easy in the Entity Framework: all that tricky database-specific stuff is gone, and you work with .NET objects that look and behave like any other .NET objects. When you call SaveChanges() on your context, Entity Framework does all the icky stuff for you. And after all, isn’t that the point?

Image
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset