How do you check if a table exists with NHibernate(or Fluent)?
database-metadata, fluent-nhibernate, nhibernate, orm
Solution
If you store you NHibernate configuration somewhere or do it before you build your session factory it is possible to validate the generated schema against the database.
public void ValidateSchema(Configuration config)
{
new SchemaValidator(config).Validate();
}
Problem
Whats the best, most consistent way to check if a table exists in NHibernate (or with Fluent-NHibernate)? Is it even possible? I mean it seems like a simple task for such a heavy-duty ORM. Also on a related question, can you check if a set of tables or a whole schema exists with NHibernate?