score:8

Accepted answer

a much better option would be to store the version differences as configuration. this could be stored in the database itself, a configuration file or even web.config.

otherwise you'll end up with messy code like:

int result = entity.executestorequery<int>(@"
    if exists (select * from sys.tables where name = 'tablename') 
        select 1
    else
        select 0
    ").singleordefault();

score:2

the only possible ways are

  • query table and get exception
  • use native sql to query system views and look for that table - in efv4 you can execute query directly from objectcontext by calling executestorequery.

your entity model will still have this table so in my opinion you should simply ship your db with that table and in application code handle if feature is allowed or not (table will not be used but will be in db).

if you want to make modular system then whole your feature (including application code) should not be present when client don't want to use it.


Related Query

More Query from same tag