I have a ModelContext with hundreds of models generated with EF DB-First (Scaffold-DbContext).
How can I search through the attributes of the models for those who have a property e.g. objid
generically. I could hard-code the check for each model, but that is not practical due to the number of tables / models (big enterprise DB).
Say I didn't know of the Students
model below. How could I still check for a property?
using (var context = new MyDbContext())
{
var students = context.Students
.Where(s => s.objid == 1234)
.ToList();
}