Using Fluent Nhibernate with Oracle stored procedure

18 views
Skip to first unread message

satish viswanath

unread,
Nov 21, 2019, 11:38:51 AM11/21/19
to Fluent NHibernate

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?



Reply all
Reply to author
Forward
0 new messages