public void WillSaveToDb() { var blog = new Blog(); var post = new Post("Title", "Text"); blog.AddPost(post); using(var scope = new TransactionScope()) { var repository = new Repository<Blog>(Session); repository.Save(blog); scope.Complete(); } }
public void WillSaveToDb() { var blog = new Blog(); var post = new Post(); blog.AddPost(post); InitDatabase(typeof(Blog).Assembly); using(var scope = new TransactionScope()) { var repository = new BlogRepository(session); repository.Save(blog); // repository.Save(post); scope.Complete(); } }