Getting Values from EF Core Context with Dynamic Calls to Tables
I'm working in EF Core 5 with Razor pages connecting to SQL Server and am trying to develop a generic form that handles multiple lookup tables. So I'm trying to dynamically access the tables in my context. My problem is that I can access the Properties (column names) of the tables themselves but I can't access the keys of the IEnumerable object when I pass it. I have a dictionary of all the tables that passes the context to the form. I can see the data is there along with the keys. How do I reach the keys (specifically CenterTypeId and CenterType in the images provided) so I can get my data without having to pass a select in my context dictionary? Some of the tables I'm going to be using have more than 2 columns and I'll need access to all the data in them. The only properties in the dbSet IEnumerable variable that I am able to access are the Entity Type and the Tracking.LocalView