I’m wondering if its possible to do this. The issue being that im trying to query the database to populate some lists. If i were to use this query:
var query =
a in db.Record_HoldData
where a.HoldStatus == "Open"
select a;
It would return all of the relevant data and I could still access and cast the data from the result object like:
DateTime time = (DateTime)query.DateOpened;
But the field Flavor is a foreign key number so its useless in this context. What I want to do is return a table intact, replacing the foreign key of flavor with the actual name from the flavor lookup table and still be able to use that data. Does that make sense? Pretty straight forward, i think.
You need to join two tables like this:
Also, add ToList(). Otherwise you will end up querying database every time you access the query, versus loading data once and reusing it.