I have a stored procedure that logs some data, how can I call this with NHibernate?
So far I have:
ISession session = ....
IQuery query = session.CreateQuery("exec LogData @Time=:time @Data=:data");
query.SetDateTime("time", time);
query.SetString("data", data);
query.?????;
What should the method ?????
be? Or am doing something more fundamentally wrong?
ExecuteUpdate on SQL Query should help you.
Sample:
ISession session = ....
IQuery query = session.CreateSQLQuery("exec LogData @Time=:time, @Data=:data");
query.SetDateTime("time", time);
query.SetString("data", data);
query.ExecuteUpdate();