It is not presently possible due to the method signature of .SuppressWithResults to pass a IDbCommand implementation that has not been derived from the base class of DbCommand; please allow the IDbCommand interface to be used.
@3GDXC the System.Data interfaces (e.g. IDbCommand) are more or less a remnant of the past, and the base classes (DbCommand) have pretty much replaced them. This can be seen by the fact that new APIs have been added to DbCommand (e.g. async methods), but not to IDbCommand (because that would have broken existing implementations of that interface).
As such, DbCommand is the standard class for representing a database command, and is the one support by the EF Core interceptor. Any reason you can't derive from it?
@roji I was hoping to use existing SQL/SQLite EF implementations and interceptors to replace the DbConnection/DbCommand with a different implementation; the implement concerned is derived from the IDbConnection/IDbCommand interfaces and is a sealed class ( we do not own the source code and is a commercial product that has no support for EF :'( )
I suppose I could create a wrapper class for these sealed classes that derives from the correct base class.
Yeah, using composition and wrapping these sealed classes sounds like the right solution here. Am closing this as we don't intend to support IDbCommand in the interceptors.
@roji thank for the help that has gave me better understanding around interceptors; examples are still needed