I'm trying to integrate Oracle stored procedure which returns a ref cursor and map to my model.
Below is the sample code that I'm using.
public class TasksMap : ClassMap<Tasks>
{
public TasksMap()
{
StoredProcedure("My_Proc", "");
Id(x => x.Id);
Map(x => x.TaskType);
Map(x => x.CustId);
Map(x => x.CreateDate);
}
}
return await _session.GetNamedQuery("My_Proc ")
.SetResultTransformer(Transformers.AliasToBean(typeof(Tasks)))
.SetParameter("in_custid", custId)
.ListAsync<Tasks>();
I'm using a ref cursor in the oracle procedure to return the records. Can someone share a sample working code?