Code through the pain Ladislav Mrnka's professional blog about software development


I finally had some time to finish reading of Programming Entity Framework DbContext by Julia Lerman and Rowan Miller. This book is like the second part of Programming Entity Framework Code First I reviewed last time. I liked this book even more than the first one. Again the book covers exactly what is said in the title because it is definitive guide to using Entity Framework DbContext API. Both books together form an ultimate resource about Entity Framework 4.1 (and newer versions) containing some interesting information not mentioned elsewhere. Authors wrote set of two books providing detailed answers to all commonly asked questions on Stack Overflow and MSDN forum.

Again my biggest complain goes to missing index in the electronic edition of the book bought directly on O'Reilly. It is not a big problem in electronic version but it would be a big disappointment if the index is not present in paper version.

There are still few topics missing in the whole Entity Framework puzzle that are not described in either of these books. These topics include mapping with designer in database and model first approaches which are possible with DbContext API as well. These topics remained same as in Entity Framework 4.0 covered in previous great Entity Framework resource: Programming Entity Framework, 2nd edition by Julia Lerman. Combining new books with few selected topics from the last mentioned book will form a knowledge base we need to learn, understand and successfully use Entity Framework and DbContext.

Programming EF DbContext Cover

I found one general suggestion at page 79 where I disagree with the book because it is incomplete. This suggestion describes importance of detaching entities when not using POCOs and claims that detaching is not needed when using POCOs. The suggestion is correct if we use pure POCOs with no lazy loading or change tracking proxies (such classes are used by examples in the book) but in case of proxied POCOs the original importance of detaching entities is still in place.

Posted on May 28, 2012 by Ladislav Mrnka

Last week I finished reading of Programming Entity Framework Code First by Julia Lerman and Rowan Miller. I am quite impressed by the content of the book because it contains exactly what the title says and nothing more. It's the definitive guide to using code mapping in Entity Framework but it doesn't cover any additional topics you are not interested in. It keeps the book thin (the real content has 176 pages) so you can finish it within less than one week and use it as reference for your upcoming experience with Entity Framework Code first. The drawback of the book's size and content is that you should not use this book for learning Entity Framework itself. You should first go through some tutorials, trainings or other books before you use this book because this book will not tell you anything about Entity Framework itself. I recommend this book to anybody who has some basic experience with Entity Framework and who is going to use or who is using Entity Framework Code first in his projects. The biggest problem I see in the book is missing index - at least digital versions bought directly on O'Reilly don't  have any. Using technical paper book without index as a reference can be pretty annoying.

Programming EF Code  First Cover

Side note: The book targets Entity Framework 4.2 so small changes in Entity Framework 4.3 and code first migrations are not covered. There is only very small chapter (2 pages) about migrations explaining what will migrations bring to Code First development approach.

Posted on April 1, 2012 by Ladislav Mrnka