I have a database first Entity Framework setup. Usually, I create procedures like this, to return a list of a defined object in my model.
public List<Employees> GetEmployees()
{
var tables = _crmContext.Employees.ToList();
return tables;
}
That works fine but the case I can't figure out, it different. I want to return a list of an object in the entity framework model, based on a parameter passed to the procedure. I was trying something like this, but it's not working and I also don't know if is the right approach.
public List<T> GetValuesFromTable(string table)
{
var results = _crmContext."table".ToList();
return results;
}
Thanks for the help.