Welcome to this installment of the .NET Nuts & Bolts column. Some of my prior .NET Nuts and Bolts columns have provided an introduction and examples with the Entity Framework (see Introducing the Entity Framework and Joins andUI Binding with the Entity Framework). This article is going to build on those columns and focus specifically on using projections to ensure you keep your query foot print smaller to help with optimal performance.

Querying Against the Model

The Entity Framework makes it a snap to write a LINQ statement that retrieves data from your model. Remember, while it looks like inline SQL, it is not. I used the sample Northwind database and generated a simple model. The following example code demonstrates querying the Customers table in the Northwind model for customers where the city of record is London. All of the matching results are returned and then written to the console. Not very exciting, but it serves the purpose to demonstrate how easy it can be.

Read More...

I guess you came to this post by searching similar kind of issues in any of the search engine and hope that this resolved your problem. If you find this tips useful, just drop a line below and share the link to others and who knows they might find it useful too. 


Stay tuned to my blogtwitter or facebook to read more articles, tutorials, news, tips & tricks on various technology fields. Also Subscribe to our Newsletter with your Email ID to keep you updated on latest posts. We will send newsletter to your registered email address. We will not share your email address to anybody as we respect privacy.