Entity Framework 4.0 Recipes: A Problem-Solution Approach (Expert's Voice in .NET

Entity Framework 4.0 Recipes: A Problem-Solution Approach (Expert's Voice in .NET
Authors
Larry Tenny, Zeeshan Hirani
ISBN
1430227036
Published
06 May 2010
Purchase online
amazon.com

Entity Framework 4.0 Recipes provides an exhaustive collection of ready-to-use code solutions for Microsoft’s Entity Framework, Microsoft’s vision for the future of data access. Entity Framework is a model-centric data access platform with an ocean of new concepts and patterns for developers to learn. With this book, you will learn the core concepts of Entity Framework through a broad range of clear and concise solutions to everyday data access tasks.

Page 2 of 2
  1. Editorial Reviews
  2. Customer Reviews

Customer Reviews

H. Zhang said
I have learned a lot from this book and used some methods in the book for my application, so I am a grateful reader. Since this book has been praised by so many reviews, I thought it would be most useful for me to state the strengths of this book quickly then follow it with my reservations that prevented me from giving 5 stars to it.

It is very readable and well organized. It is more than a collection of recipes because the first few chapters could give a beginner a good start on EF. Some people may think it has a lot of redundancy by providing a complete list of the code for each recipe, I personally like the completeness (I have the eBook version so the thickness does not bother me at all).

Here are my reservations:

1. There are three methods to query a conceptual model in EF - LINQ to Entities, Entity SQL, Query builder methods. This could be confusing to novice readers. The book mixes all of them and it may be the best approach to mix them to achieve the most elegant code, but I wish the author could share the rationale of each mixture which can be very educational.

2. Each recipe is a method to solve a problem with a specific approach but it may not be the best overall method. I wish the book could clearly point out this. A typical example is recipe 4-3 which is a method for signing a value to a property with code during data saving. This is a very common scenario for data entry applications (e.g. setting the user ID value which is not entered by the user for each record) and it is usually achieved by a single line of code in an event handler of a control. In the case of the recipe, it can be handled by one statement in the ItermInserting handler of the DetailsView, but the recipe uses a pure EF way of creating a partial method to intercept SavingChanges event.

3. I think the best way to achieve a solid data model is to have a solid database design and the EF conceptual model should just be a reflection of that. EF has matured a lot but the latest version EF 4.0 still has some glitches or undesirable behaviors. It is quite possible that someone may have to recreate the model from the database and it may happen many times. If a lot of "custom" modifications are made to EF model, all of them have to be repeated and this may require a lot of work, good documentation or memory. The book has a lot recipes doing exact this and some of them even get into the XML code editing. I wish the book could clearly point out the caveats of doing this.

Scooby Down Under said
This book is an excellent addition to add to an already cluttered desk that provides a quick reference for scenarios you need to solve using EF4. Although EF4 is a massive improvement on the initial version, it still has limitations; this book provides some creative ways to get around these, whilst also making the pros and cons in the presented solutions clear.

We've only had our copy for a couple of weeks, and it's already well worn!

Harsh Bhasin said
I highly recommend this book. It has saved me a lot of effort browsing the net for code samples. The authors have invested a lot of time and effort compiling recipes that Entity Framework programmers would need to use in their projects. Can't say enough good things about the book.

RDCEI said
I bought this book 8 minutes ago via WhisperNet, and it's already solved a problem I was fighting for four hours. An excellent resource already, worth every penny.

Viktar Karpach said
This is excellent book with a lot real life examples. Usually developers think in terms of database. Table maps to an object, LINQ to SQL kind of approach.

However EF4.0 gives you ability to map your objects to part of the table or to multiple tables. It shows you how inheritance can be represented in database.

Even if you not going to use EF in your working environment, still this book gives you a lot of ideas and best practices to think of.

You might also like...

Comments

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”