What I am looking for is actually the equivalence of the following code that I used in a EntityFramework project:
ObjectQuery<DbDataRecord> query = new ObjectQuery<DbDataRecord>(@"select so.ORDER_NUMBER,note.DESPATCH_NUMBER
from SALES_ORDER_HEADERS as so
INNER JOIN DESPATCH_NOTES as note
on note.ORDER_NUMBER = so.ORDER_NUMBER
", entityContext);
grid.ItemsSource = query;
the purpose here is to write Entity Sql string with INNER JOIN key word inside, and execute the string(of course it's composed during runtime) within IdeaBlade.
I wrote something like this:
input.Text = @"SELECT so.OrderNumber,note.DespatchNumber FROM SalesOrderHeaders AS so
INNER JOIN DespatchNote AS note on note.OrderNumber = so.OrderNumber
";
var query1 = new PassthruEsqlQuery(typeof(object), typeof(SalesOrderHeader), input.Text);
var results1 = query1.With(mgr).Execute();
and I got the error of this:
'DespatchNote' could not be resolved in the current scope or context. Make sure that all referenced variables are in scope, that required schemas are loaded, and that namespaces are referenced correctly. Near simple identifier, line 2, column 13.
So my question is how should I make the second entity known to the scope or context?