Solved

public DbSet<Course> Courses { get; set; }

Posted on 2014-04-02
1
277 Views
Last Modified: 2014-04-02
Trying to understand what this really mean in MVC

 public DbSet<Course> Courses { get; set; }

I'm guessing DbSet<Course> refer to the class and Courses is the entities of the class right
0
Comment
Question by:yguyon28
1 Comment
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39973303
Per the documentation:

A DbSet represents the collection of all entities in the context, or that can be queried from the database, of a given type.

So, the context more or less represents your database, and the DbSet is a container for entities you retrieve from the context. Course is a class that is most likely defined with the same columns (and data types) found in that table in the database. An instance of Course is considered to be an entity.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now