Lets say my stored procedure is something like
create procedure mySp
As
select a, b, c, d, e from aTable
End
I want to get the value of d for the last row. That is the only value that I am interested in. I don’t want to map the result to a C# object or anything. Just need the value of d for the last row.
What should my nhibernate query look like?
Here is how I would start the call. But I can’t get to the rest of it:
return unitOfWork.Session.CreateSQLQuery("exec mySP"). ??
You want to use Object-Relational Mapping tool but without objects and mapping. The most convenient way – don’t do this, just use old-school
SqlCommandfor that.if all you have is a hammer, everything looks like a nail