A have an action on my MVC application that have an id
and returns a person's name.
What is the best practice for that? I'm following NHProf tips, but code sounds a little strange or something for me.
using (var session = Helper.SessionFactory.OpenStatelessSession())
{
using (var tran = session.BeginTransaction(IsolationLevel.ReadCommitted))
{
return session.Query<Person>().Where(x => x.Id == id).Select(x => x.Name).SingleOrDefault();
tran.Rollback();
}
}