Well, the question, however that may be. I am currently doing something like this:
using (var session = _sessionFactory.OpenSession()) { using (var transaction = session.BeginTransaction()) { Car newCar = new Car(); newCar.name = "Jeep"; session.Save(newCar); transaction.Commit(); } }
source share