Created
November 17, 2016 00:23
-
-
Save imeanitworks/59c134ff3bbd1e4c488463a7d730a6fb to your computer and use it in GitHub Desktop.
Enterprise library class extension to use the oracle managed drivers
This file contains hidden or 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
| using Microsoft.Practices.EnterpriseLibrary.Data; | |
| using Oracle.ManagedDataAccess.Client; | |
| using System.Data; | |
| namespace Helpers | |
| { | |
| public static class ManagedClassExtensions | |
| { | |
| public static OracleDataReader ExecuteReader(this Database database, OracleCommand cmd) | |
| { | |
| return cmd.ExecuteReader(); | |
| } | |
| public static OracleCommand GetSqlStringCommandManaged(this Database database, string sqlCommand) | |
| { | |
| OracleCommand cmd = new OracleCommand(sqlCommand); | |
| cmd.BindByName = true; | |
| return cmd; | |
| } | |
| public static OracleCommand GetStoredProcCommandManaged(this Database database, string storedProcName) | |
| { | |
| OracleCommand cmd = new OracleCommand(storedProcName); | |
| cmd.CommandType = CommandType.StoredProcedure; | |
| cmd.BindByName = true; | |
| return cmd; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment