public void Movie_cascades_save_to_ActorRole() { Guid movieId; Movie movie = new Movie() { Name = "Mars Attacks", Description = "Sci-Fi Parody", Director = "Tim Burton", UnitPrice = 12M, Actors = new List<ActorRole>() { new ActorRole() { Actor = "Jack Nicholson", Role = "President James Dale" } } }; using (var tx = Session.BeginTransaction()) { movieId = (Guid)Session.Save(movie); tx.Commit(); } Session.Clear(); using (var tx = Session.BeginTransaction()) { movie = Session.Get<Movie>(movieId); tx.Commit(); } Assert.That(movie.Actors.Count == 1); }
static void UpdateMoviePrice(Movie movie) { // Random price between $9.95 and $24.95 movie.UnitPrice = (decimal) rnd.Next(10, 26) - 0.05M; }
public virtual void SaveMovie(Movie movie) { _movieDao.Save(movie); }