Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 static void UpdateMoviePrice(Movie movie)
 {
     // Random price between $9.95 and $24.95
       movie.UnitPrice = (decimal) rnd.Next(10, 26) - 0.05M;
 }
Esempio n. 3
0
 public virtual void SaveMovie(Movie movie)
 {
     _movieDao.Save(movie);
 }