Last post Oct 08, 2015 11:18 AM by PatriceSc
Jun 12, 2015 03:10 PM|alexanderkao|LINK
I am looking for an definition that fits these 2 requirements.
1. The definition must not soley tell me what it does. I want to know what its is.
2. Try using simple words, so then I won't have to look up another word to understand the word I want to understand. For example, if a DbContext is an aghsdfhasdsad, do not tell me that a DbContext is an aghsdfhasdsad because I don't know what an aghsdfhasdsad
Jun 12, 2015 03:40 PM|alexanderkao|LINK
Also, 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:52 PM|Mikesdotnetting|LINK
The DbContext is a compoient in the Entity Framework. It has a number of functions:
DbSets are collections of domain objects, entities, business objects, call them whatever you like it all means the same thing. They normally map one-to-one with database tables as I described in reply to your similar post on the topic: http://forums.asp.net/t/2055163.aspx?What+is+the+relationship+between+a+DBContext+class+and+a+model+in+a+EntityFramework+MVC+program+
Jun 12, 2015 04:20 PM|alexanderkao|LINK
Thank you for your response.
I did not find it helpful.
Can you make your response beg. friendly and useful?
Also, I said not to include answers that solely tell me what it does instead of it what it is. Telling me that a DBContext is a component of Entity Framework does not really tell me anything. That statement is pretty vague.
Also I said not to use the word entity unless one is directly references to the entity framework. Look at my second req.
Thank you very much.
Jun 12, 2015 04:29 PM|Mikesdotnetting|LINK
Perhaps it would help if you could explain what exactly you have difficulty in understanding.
Jun 12, 2015 05:05 PM|alexanderkao|LINK
Your reply to my other thread is unviewable. Can you make that viewable, please? I want to know what a DBContextClass is
and what a DBSet is. I know that most(if not all) programming sources like to explain things by starting all over the place. Meaning, they almost never start from something simple before building up. They normally pick a random concept
that the reader may or may not know and then build from there. In other words, beginners like me get shafted. In this case, I don't know where to start to understand what a DBContextClass or what a DBSet is. I want to know where to start. Please do not give
me any links. I find most online sources and online videos useless because they always assume I know something without telling me what I should know in the first place.
Jun 12, 2015 08:14 PM|ryanbesko|LINK
In other words, beginners like me get shafted. In this case, I don't know where to start to understand what a DBContextClass or what a DBSet is. I want to know where to start. Please do not give me any links. I find most online sources and online videos useless
because they always assume I know something without telling me what I should know in the first place.
It is rude that you would ask a question and say such things in a forum post that is related to a specific topic. Forums are not for you to ask "show me from the beginning", or to say don't use the word entity unless you are talking about Entity Framework.
DbSet and DbContext are only related to Entity Framework. Forums are meant to help when you try something from a link (which you specifically state you won't accept) and get stuck. They are not meant to be a training course.
And for Mike to give you such a good answer to your question and you say it's not helpful... well...
Jun 13, 2015 04:09 AM|Mikesdotnetting|LINK
It's impossible to explain an extremely complex thing like a DbContext without explaining what its purpose is - ie, what it does. These things are the sum of their functions. It is equally difficult to explain something in terms that another person might
understand when you don't know what terms the other person understands.
I find most online sources and online videos useless because they always assume I know something without telling me what I should know in the first place.
To understand the DbContext, I guess you would find it useful to have some context in which to place it. So you would most likely need to know what an ORM tool is, why people would use it and (broadly) how it does its thing. Then you can start looking at
which components within the tool are responsible for which tasks. Is that your starting point?
Oct 08, 2015 11:18 AM|PatriceSc|LINK
So trying to be minimalistic.
The purpose of Entity Framework is to expose your data as directly as possible as objects.
The DbContext is the class which is responsible for exposing a particular database this way.
The DbSet is the class which is responsible for exposing a particular table within this database. They belong to a DbContext.