My procedure is returning two result sets/tables, I want to read those two result sets into two different lists and bind that list.
I'm able to read one result set into a list but I tried various ways to read multiple result sets into the dynamic list but it is giving me "TTC Error Oracle".
How to read multiple result sets using QueryMultiple?
Code for reading single result set into dynamic list:
public ResponseModel GetDoctorDetails(CustomerRequest data)
{
try
{
var p = new OracleDynamicParameters();
p.Add("p_parameter1", data.PARAMETER1, dbType: OracleDbType.Int32, direction: ParameterDirection.Input, size: 8);
p.Add("p_parameter2", data.PARAMETER2, dbType: OracleDbType.Int32, direction: ParameterDirection.Input, size: 8);
p.Add("p_out_cursor", dbType: OracleDbType.RefCursor, direction: ParameterDirection.Output, size: 0);
using (var multi = _oracleConnection.QueryMultiple("procedure_name", param: p, commandType: CommandType.StoredProcedure))
{
List<dynamic> list = multi.Read<dynamic>().AsList();
return new ResponseModel { ResultSet = list, StatusCode = 1, StatusDescription = "Success" };
}
}
catch (Exception ex)
{
throw ex;
}
}
I tried following ways to read multiple result sets but it is giving me "TTC Error"
List<DataTable> list = new List<DataTable>();
list = multi.Read<DataTable>().AsList();
and
List<List<dynamic>> list = new List<List<dynamic>>();
list = multi.Read<List<dynamic>>().AsList();
Please help.