Esempio n. 1
0
 public void Add(Movie movie)
 {
     var movies = GetAll().ToList();
     if (!movies.Contains(movie))
     {
         movies.Add(movie);
         Save(movies);
     }
 }
Esempio n. 2
0
 public void RemoveMovie(Movie movie)
 {
     if (Movies.Contains(movie))
     {
         _storage.Remove(movie);
     }
     else
     {
         throw new System.ArgumentException("The movie does not exist");
     }
 }
Esempio n. 3
0
 public void Remove(Movie movie)
 {
     var movies = GetAll().ToList();
     if (movies.Contains(movie))
     {
         movies.Remove(movie);
         Save(movies);
     }
     else
     {
         throw new System.ArgumentException("The movie does not exist");
     }
 }
Esempio n. 4
0
 public void AddMovie(string name)
 {
     int id = GetMovieId();
     var movie = new Movie(id, name);
     _storage.Add(movie);
 }