Solved

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

Posted on 2014-04-02
1
293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

752 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