I am using Entityframework 6 Database first. The application I'm building will allow users to change the connection strings. After I tested the newly entered connection string validity, I wanted to check if the tables that are on edmx models really exist on the given connection string.
So I tried this:
let's say I have ExampleEntity on edmx.. to check if it exists on the real database table I used..
try{
dbContext.ExampleEntity.ToList();
return true; // the table exist
}
catch{
return false;
}
Is there a better way to check the existence of the database tables using Entityframework?