Want to extract the text value from a lookup table’s column in a db. EL is the entity for my db. Current code :
var QTypes = EL.ElogQueryType.Where<ElogQueryType>( eqt=> eqt.ID == queryTypeID);
string qType = QTypes.First().QueryType;
I get a list when I just pull .Select(... so something is wrong.
You should be able to just do if you know you will be just getting one item:
If you are not sure if you will get one or nothing use
SingleOrDefault().If you just want the first since you are expecting many records do:
Same applies if you don’t know if you will get anything, use
FirstOrDefault.