Skip to content

Instantly share code, notes, and snippets.

@nakamura-to
Created April 16, 2012 12:12
Show Gist options
  • Save nakamura-to/2398326 to your computer and use it in GitHub Desktop.
Save nakamura-to/2398326 to your computer and use it in GitHub Desktop.
Enabling BindByName to Oracle stored procedure calls in Soma
internal class MyCommandObserver : ICommandObserver
{
public void NotifyExecuting(DbCommand command, PreparedStatement statement, out object userState)
{
OracleCommand oracleCommand = command as OracleCommand;
if (oracleCommand != null && oracleCommand.CommandType == CommandType.StoredProcedure)
{
oracleCommand.BindByName = true;
}
userState = null;
}
public void NotifyExecuted(DbCommand command, PreparedStatement statement, object userState)
{
}
}
internal class MyConfig : OracleConfig
{
private static readonly ICommandObserver MyCommandObserver = new MyCommandObserver();
public override string ConnectionString { get { return @"..."; } }
public override ICommandObserver CommandObserver { get { return MyCommandObserver; } }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment