private static Movie MapToMovie(MovieResource movieResource)
 {
     return(new Movie(
                title: movieResource.Title,
                imageUrl: movieResource.ImageUrl,
                genre: (Genre)movieResource.Genre,
                year: movieResource.Year));
 }
示例#2
0
        public override async Task <CreateMovieResponse> CreateMovie(MovieResource request, ServerCallContext context)
        {
            try
            {
                var id = await _domainFacade.CreateMovie(MapToMovie(request));

                return(new CreateMovieResponse {
                    Id = id
                });
            }
            catch (Exception e)
            {
                throw MapToRcpException(e);
            }
        }