title: Why can I not cast IDbTransaction in ServiceStack OrmLite to DbTransaction?
body: <p>I am using <code>ServiceStack.Ormlite v3.9.71</code> and have the following piece of code where I open an Ormlite SQLite Transaction, suppose I want to use this transaction in a command elsewhere in the code:</p>
  
  <pre><code>var connFactory = new OrmLiteConnectionFactory("ConnectionString", SqliteOrmLiteDialectProvider.Instance)
  using (IDbConnection db = connFactory.Open()) // using var doesn't make a difference
  using (IDbTransaction tran = db.OpenTransaction()) // using var or even db.BeginTransaction() doesn't make a difference
  {
      // I do lots of boring stuff
      ...
  
      // Somewhere else in the code
      using (var cmd = db.CreateCommand())
      {
          cmd.Transaction = tran; // get an error
      }
  }    
  </code></pre>
  
  <p>however when I do, I get the:</p>
  
  <pre><code>A first chance exception of type 'System.InvalidCastException' occurred in System.Data.dll
  
  Additional information: Unable to cast object of type 'ServiceStack.OrmLite.OrmLiteTransaction' to type 'System.Data.Common.DbTransaction'. 
  </code></pre>
  
  <p>And the Stack Trace:</p>
  
  <pre><code>   at System.Data.Common.DbCommand.System.Data.IDbCommand.set_Transaction(IDbTransaction value)
  </code></pre>
  
  <p>I guess this is due to the OrmLiteTransaction wrapper, how can I get to the transaction?</p>