It works with DynamicParameters (no need for OracleDynamicParameters). Using dbType: DbType.Object for the output cursor.
I also needed to make the results object specific:
var searchResults = new List<customer>();</customer>
No change to the Oracle sproc, final calling code looks like this:
public List<customer> SearchCustomers(string searchCriteria, string showDetailsFlag)
{
try
{
var searchResults = new List<customer>();
using (var conn = new OracleConnection(DatabaseConnectionString))
{
conn.Open();
var p = new DynamicParameters();
p.Add("pSearchCriteria", searchCriteria, DbType.String, ParameterDirection.Input);
p.Add("pShowDetails", showDetailsFlag, DbType.String, direction: ParameterDirection.Input);
p.Add("o_resultset", dbType: DbType.Object, direction: ParameterDirection.Output);
searchResults = conn.Query(sql: CommonConstants.ProcedureConstants.PKG_SEARCH_CUSTOMERS, param: p, commandType: CommandType.StoredProcedure)
.Select(c => new Customer
{
CustomerId = c.CWID,
CompanyName = c.COMPANY_NAME,
PhoneNumber = c.PHONE_NUMBER
}).ToList();
conn.Close();
return searchResults;
}
}
catch (Exception ex)
{
throw ex;
}
}</customer></customer>