Related Titles
- Full Description
-
Entity Framework 4.0 Recipes provides an exhaustive collection of ready-to-use code solutions for Entity Framework, Microsofts 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. Armed with this experience, you will be ready to dive deep into Entity Framework, experiment with new approaches, and develop ways to solve even the most difficult data access challenges. If you are a developer who likes to learn by example, then this is the right book for you.
- Gives ready-to-use, real-world recipes to help you with everyday tasks
- Provides guideposts for learning core concepts
- Maps out key landmarks for experimenting with your own solutions
What youll learn
- Solve the most common data access problems using Entity Framework.
- Implement basic data access design patterns using Entity Framework.
- Seamlessly model your solutions across both code and data.
- Improve data access performance.
- Use data binding to simplify and reduce your code.
- Leverage the recipes to empower your own exploration of Entity Framework.
Who this book is for
This book is for anyone learning Microsofts Entity FrameworkMicrosofts primary data access platform. If you have ever struggled to learn a new technology, programming model, or way of doing something, you know how helpful simple, real-world examples can be. For the beginning developer, this book provides concrete examples for common data access tasks. For developers with experience with previous Microsoft access platforms, this book provides a task-by-task mapping between previous approaches and the patterns used in Entity Framework.
- Table of Contents
-
Table of Contents
- Getting Started With Entity Framework
- Entity Data Modeling Fundamentals
- Querying an Entity Data Model
- Using Entity Framework in ASP.NET
- Loading Entities and Navigation Properties
- Beyond the Basics with Modeling and Inheritance
- Working with Object Services
- Plain Old CLR Objects
- Using the Entity Framework in N-Tier Applications
- Stored Procedures
- Functions
- Customizing Entity Framework Objects
- Improving Performance
- Concurrency
- Advanced Modeling
- Source Code/Downloads
- Errata
-
If you think that you've found an error in this book, please let us know about it. You will find any confirmed erratum below, so you can check if your concern has already been addressed.
On page 41:
Error / incomplete / mileading sourcecode chapter 2-7.
It is not necessary to include PhotoId for the PhotographFullImage. In fact even a wrong PhotoId here makes no difference, it is accepted and never used, and no error pops up.
This is because of the way you relate the objects:
photo.PhotographFullImage = fullImage;
context.Photographs.AddObject(photo);
If you instead write as follows, then the PhotoId is used and needed:
context.Photographs.AddObject(photo);
context.PhotographFullImageSet.AddObject(fullImage);
On page 41:
Microoft must-be error.
I changed the high resolution image to a 100 000 000 byte array.
Accessing this byte array directly in for loop, or using its length property directly in the for loop failed totally. When only accessing the Length property in the for loop it appeared that 100's of MB where copied & deleted internally for each acces of the Length property. The thing never finished, Visual Studio hanged.
This code flies along:
byte[] fullBits = new byte[100000000];
photo.HighResolutionBits.CopyTo(fullBits, 0);
int len = photo.HighResolutionBits.Length;
for (int n = 0; n < len; n++)
{
fullBits[n] += fullBits[n];
}
This code fails big-time, never finishes:
byte[] fullBits = new byte[100000000];
for (int n = 0; n < photo.HighResolutionBits.Length; n++)
{
fullBits[n] += n;
}
This fails to finish also:
byte[] fullBits = new byte[100000000];
photo.HighResolutionBits.CopyTo(fullBits, 0);
int len = photo.HighResolutionBits.Length;
for (int n = 0; n < len; n++)
{
fullBits[n] += photo.HighResolutionBits[n];
}
Debug or Release mode make no difference.
On page 95:In Recipe 3-12 "Applying a Left Outer Join" the resulting set does not seem to represent a Left Outer Join.
The text implies that all Products should be returned regardless of whether or not a related TopSelling Entity exists. If it were a Left Outer Join the expected result set would include the product "Trailrunner Backpack".






