DbContext class is the one among others that the Entity Framework team has created, in order to facilitate developers when accessing and manipulating database data. In a nutshell, DbContext, DbSet, and DbQuery are the classes that have encapsulated the most frequently used patterns and functions while working with Entity Framework, replacing the old ObjectContext, ObjectSet and ObjectQuery respectively. In this post we will show how to use the DbContext class in order to retrieve data from database. We will use LINQ to Entities and LINQ to Objects queries to get data from database. Before continuing reading this post, if you are new either to Entity Framework or the LINQ I would strongly recommend you to read the related posts on this blog, Starting with Code First in Entity Framework and LINQ to Objects queries. Here's what we are gonna look at this post:


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.


This article is related to

</ span>C#,.NET,Architect,Intermediate,VS2010,.Net,Articles,Computer Tutorials