Exemple #1
0
 public MovieReturnModel(CourseProject.DB.Entities.Movie movie)
 {
     this.Id           = movie.Id;
     this.Title        = movie.Title;
     this.DirectorName = movie.DirectorName;
     this.GenreName    = movie.GenreName;
 }
Exemple #2
0
        public string AddMovie(MovieAddModel movie)
        {
            CourseProject.DB.Entities.Movie nmovie = new CourseProject.DB.Entities.Movie();
            nmovie.DirectorName = movie.DirectorName;
            nmovie.GenreName    = movie.GenreName;
            nmovie.Title        = movie.Title;
            uow.MovieRepository.Create(nmovie);

            return("Book is added successfully");
        }
Exemple #3
0
        public string DeleteMovie(int MovieId)
        {
            CourseProject.DB.Entities.Movie movie = uow.MovieRepository.GetById(MovieId);
            if (movie == null)
            {
                throw new Exception($"Could not find movie with ID: {MovieId}");
            }

            uow.MovieRepository.DeleteByID(MovieId);
            return("Book is deleted successfully");
        }
Exemple #4
0
        public MovieReturnModel GetByID(int MovieId)
        {
            CourseProject.DB.Entities.Movie movie = uow.MovieRepository.GetById(MovieId);
            if (movie == null)
            {
                throw new Exception($"Could not find movie with ID: {MovieId}");
            }

            MovieReturnModel result = new MovieReturnModel();

            return(result);
        }