public ActionResult <WatchedMovieModel> Add([FromBody] AddWatchedMovieModel movie)
        {
            var movieToReturn = facadeWatchedMovies.AddWatchedMovie(movie, CurrentUser.Id);
            var links         = CreateLinksForMovie(CurrentUser.Id, movieToReturn.Id);

            return(generateResult(movieToReturn, links));
        }
Beispiel #2
0
 public static MovieDetailsJMDBApi MapWatchedMovie(AddWatchedMovieModel movieModel)
 {
     return(new MovieDetailsJMDBApi
     {
         Name = movieModel.Name,
         Actors = movieModel.Actors,
         Year = movieModel.Year,
         Director = movieModel.Director,
         Duration = movieModel.Duration,
         Genre = movieModel.Genre,
         Country = movieModel.Country,
     });
 }
        public WatchedMovieModel AddWatchedMovie(AddWatchedMovieModel movie, long currentUserId)
        {
            var addedMovie = WatchedMoviesManager.Add(Mapper.Mapper.MapWatchedMovie(movie), currentUserId, movie.Comment, movie.Rate, movie.DateTimeWatched, movie.Poster, movie.Id);

            return(Mapper.Mapper.Map(addedMovie));
        }