I tried to use IDbCommandInterceptor (https://entityframework.codeplex.com/wi ... terception).
I wanted to change the command
public void ReaderExecuting(DbCommand command, DbCommandInterceptionContext<DbDataReader> interceptionContext)
{
command.CommandText = command.CommandText + " OR Extent1.BookId = :p1";
var parameter = command.CreateParameter();
parameter.ParameterName = "p1";
parameter.DbType = DbType.Int64;
parameter.Value = 2;
command.Parameters.Add(parameter);
}
And it throw exception
Object reference not set to an instance of an object
I think it is because the parameter in command.Parameters has a type Devart.Data.Oracle.Entity.m (internal class), and the parameter type from command.CreateParameter() is Devart.Data.Oracle.OracleParameter?
How can i add a parameter to a command?
Error when adding parameter to command in IDbCommandInterceptor.ReaderExecuting
Re: Error when adding parameter to command in IDbCommandInterceptor.ReaderExecuting
We have reproduced the issue and are investigating it.
Re: Error when adding parameter to command in IDbCommandInterceptor.ReaderExecuting
The bug with generating NRE when adding parameter to a command in IDbCommandInterceptor.ReaderExecuting in Entity Framework 6 is fixed. We will post here when the corresponding build of dotConnect for Oracle is available for download.
Re: Error when adding parameter to command in IDbCommandInterceptor.ReaderExecuting
New version of dotConnect for Oracle 7.9 is released!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=27875.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=27875.