How to call oracle function using Mono?-Collection of common programming errors

Working with Mono I needed to call a function in an oracle database. The function has two input parameters and one output parameter.

At first I tested with .Net runtime. The following pretty simple code did the job:

var dbcon = new OracleConnection("my connection string");
dbcon.Open();

OracleCommand cmd = dbcon.CreateCommand();
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "my_pkg.my_func";

OracleParameter p = new OracleParameter("ReturnValue", OracleType.Number);
p.Direction = ParameterDirection.ReturnValue;
cmd.Parameters.Add(p);

p = new OracleParameter("p_in1", OracleType.VarChar);
p.Size = 5;
p.Direction = ParameterDirection.Input;
p.Value = p1;
cmd.Parameters.Add(p);

p = new OracleParameter("p_in2", OracleType.VarChar);
p.Size = 20;
p.Direction = ParameterDirection.Input;
p.Value = p2;
cmd.Parameters.Add(p);

p = new OracleParameter("p_out", OracleType.VarChar);
p.Direction = ParameterDirection.Output;
p.Size = 512;
cmd.Parameters.Add(p);    

cmd.ExecuteNonQuery();

return cmd.Parameters["p_out"].Value.ToString();

However, as the target OS is Linux, I changed the runtime (Utilities=>Options=>.Net Runtimes) to Mono (ver. 2.10.9). The first issue I experienced then was the bug mentioned in

As far as I understand the only way out is to set OracleParameter.Value before OracleParameter.OracleType, even for output parameters… So the code was changed to

p = new OracleParameter();
p.ParameterName = "p_in1";
p.Size = 5;
p.Direction = ParameterDirection.Input;    
p.Value = code.ToString ();                
p.OracleType = OracleType.VarChar;

The NullReferenceException disappeared, but another arrised:

PLS-00306: wrong number or types of arguments in call to ‘my_func’

ORA-06550: line 1, column 7: PL/SQL: Statement ignored

As it is said in Mono – Oracle: Current Status for System.Data.OracleClient :

Input/Output and Return parameters have not been tested.

is ParameterDirection.ReturnValue even supported?

Or why does it work with the .Net runtime and does not with Mono?