/// <summary> /// Returns a specific movie by id /// </summary> /// <param name="id"></param> /// <returns>EntertainmentModel.Movie</returns> public EntertainmentModel.Movie GetMovieById(int id) { ServiceLibrary.EntertainmentServiceClient sC = new ServiceLibrary.EntertainmentServiceClient(); var movie = sC.GetMovieById(id); EntertainmentModel.Movie convertedMovie = ConvertToModelMovie(movie); return(convertedMovie); }
/// <summary> /// Converts a specific service Movie to FlixNet models Movie /// </summary> /// <param name="serviceEntertainments"></param> /// <returns>EntertainmentModel.Movie </returns> private EntertainmentModel.Movie ConvertToModelMovie(FlixNet.ServiceLibrary.Movie serviceEntertainments) { EntertainmentModel.Language language = new EntertainmentModel.Language { Id = serviceEntertainments.Language.Id, Name = serviceEntertainments.Language.Name }; EntertainmentModel.Genre genre = new EntertainmentModel.Genre { Id = serviceEntertainments.Genre.Id, Name = serviceEntertainments.Genre.Name }; EntertainmentModel.Country country = new EntertainmentModel.Country { Id = serviceEntertainments.Country.Id, Name = serviceEntertainments.Country.Name }; EntertainmentModel.Movie convertedMovie = new EntertainmentModel.Movie { Id = serviceEntertainments.Id, Genre = genre, Title = serviceEntertainments.Title, Country = country, Language = language, ReleaseDate = serviceEntertainments.ReleaseDate, StoryLine = serviceEntertainments.StoryLine, FilmingLocation = serviceEntertainments.FilmingLocation, Information = serviceEntertainments.Information, Comments = ConvertToModelComments(serviceEntertainments.Comments) }; return(convertedMovie); }