A column on its own isn't enough; you'll need to read the column values from a specific entity.
Once you have an entity, you can use the DbContext.Entry
method to get the DbEntityEntry
instance for that entity. The CurrentValues
property will then give you access to the current property values for that entity.
using (var dbContext = new db_ReadyEngine_MSSQL())
{
var entity = dbContext.Set<tbl_ObisSchema>().Find(thePrimaryKeyToFind);
if (entity == null) throw new InvalidOperationException("Record not found");
var entry = dbContext.Entry(entity);
var currentPropertyValues = entry.CurrentValues;
List<Tuple<string, object>> list = currentPropertyValues.PropertyNames
.Select(name => Tuple.Create(name, currentPropertyValues[name]))
.ToList();
// Do something with the list...
}