'Are the both "In the Data Base" and "On the Data Base" correct?| ASP.NET Core API
I run into the following statement when I was reading a book about Learning ASP.NET Core API:
We reference “CommandItems” on our DB Context (_context) and return as a List of Command objects.
A complete explanation shown below:
And here is some explanations of the picture added above:
- Class constructor utilizing the injection of or DB Context.
- We reference “CommandItems” on our DB Context (_context) and return as a List of Command objects.
- We call the FirstOrDefault method on our “CommandItems” to return a Command object (if one exists) that matches our desired ID.
I now have two questions about number 2:
- We reference “CommandItems” on our DB Context (_context) and return as a List of Command objects.
1- Is it "on our DB Context" or "in our DB Context"? Are the both true?
2- What do we return when saying:
and return as a List of Command objects?
Have anything omitted after the the term "return"? (i.g. return them as..., or return CommandItems as...)
Solution 1:[1]
- You can understand that your database
Command Database(DbContext) has the table with nameCommandItems - A database table should have multiple records, that why returning a List of objects corresponding to those records.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mtdot |

