Quick question.. In a function that checks if a certain Terminal Id is available, is it okay for me to do it as below?
using (var tx = session.BeginTransaction())
{
return ((new TerminalDAO(sm.Session)).Get(tid) == null) ? true : false;
}
Or is it advisable to do it with the Commit()?
Terminal terminal = null;
using (var tx = session.BeginTransaction())
{
terminal = (new TerminalDAO(session)).Get(tid);
tx.Commit();
}
return (terminal == null) ? true : false;