Last post Jun 12, 2015 03:44 PM by Mikesdotnetting
Jun 12, 2015 03:33 PM|alexanderkao|LINK
What is the relationship between a DBContext class and model in a EntityFramework MVC program?
Please don't use the word entity. Many sources use the word to mean row and tables, which can be really confusing. Please do not use the word entity unless you are mentioning the entity framework.
Jun 12, 2015 03:44 PM|Mikesdotnetting|LINK
The model's classes normally map one-to-one with DbSets that belong to the DbContext class. Those DbSets then map one-to-one with database tables. So, for example, you might see this:
Model Classes DbContext Database Tables
Product <-> DbSet<Product> <-> Products
Category <-> DbSet<Category> <-> Categories
Order <-> DbSet<Order> <-> Orders