Ejemplo n.º 1
0
        /// <summary>
        /// Handling get request and response
        /// </summary>
        /// <param name="request">Messaging.MovieRatings.GetMovieRatingRequest</param>
        /// <returns>Messaging.MovieRatings.GetMovieRatingResponse</returns>
        public GetMovieRatingResponse GetMovieRating(GetMovieRatingRequest request)
        {
            var response = new GetMovieRatingResponse()
            {
                Request       = request,
                ResponseToken = Guid.NewGuid()
            };

            try
            {
                response.MovieRating = _repository.FindAll(request.Id).MapToView();
                response.Success     = true;
            }
            catch (Exception ex)
            {
                response.Message = ex.Message;
                response.Success = false;
            }

            return(response);
        }