Created
April 16, 2012 12:12
-
-
Save nakamura-to/2398326 to your computer and use it in GitHub Desktop.
Enabling BindByName to Oracle stored procedure calls in Soma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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