I am debugging some Entity Framework code in Visual Studio 2008, and I’m trying to retrieve actual values from the database. I expect to see a set of ID, Name pairs from one static table.
using (MyModel context = new MyModel())
{
var stat = context.StatusSet.First(x => x.ID == 1);
//...
}
When I look into context I instead see that context.StatusSet.Name has the value of “it”.
What does this mean?
In SQL variants like T-SQL, there is an implicit this object, so you only need to specify the column names. However, you can specify an alias for a table (e.g., SELECT a.* FROM Table a).
The Entity Framework has the ability to run queries using ESQL (or Entity SQL), which is a SQL based langauge. In ESQL, there isn’t an implicit this scope, you need to explicitly use “it” to refer to the current scope.
Erick