I was trying to get the model a page is looking to and send data based on the Model received. I have tried the following code but it says 'model' is a variable but is used as a Type
public IActionResult GetComments(string modelName)
        {
Type model = Type.GetType(modelName+", UHDMS.Models");
                var mapping = _context.Model.FindEntityType(model);
                tablename = mapping.GetTableName();
                var props = _context.Model.GetEntityTypes().Single(e => (e.GetTableName().OfType<model>()).Equals(tablename)).GetProperties();
}
Note: error is happening on this line e.GetTableName().OfType()
