From the course: .NET Essentials: LINQ for Databases

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

DbSet, the basis for EF collection models

DbSet, the basis for EF collection models - .NET Tutorial

From the course: .NET Essentials: LINQ for Databases

Start my 1-month free trial

DbSet, the basis for EF collection models

- It's time to see the DB Set and action. Well let's see how it fits into the entity framework. So remember, in entity framework I've defined all of these properties on the DB context. So there's categories and contexts. And what I'm looking at in this video is regions. So I want to retrieve one item from this set of data. And the way I'm doing that is I'm instantiating an instance of my DB context up here, new Northwind entities. And then I'm using that down here to output the information in this property. Now this property, if we were to look at it in visual studio, it is a property on the DB context class and it's implemented like this online seven. So it's a virtual DB Set of region. It's named regions and it has a property getter and a setter. And each row in the regions table is mapped to the region class. So what I'm doing in my code, is I'm getting the regions and I'm outputting it using the dump…

Contents