Ejemplo n.º 1
0
        public HttpResponseMessage UpdateMoviesCommand(MoviesViewModel command)
        {
            try
            {
                var UpdateMoviesCommand = new UpdateMoviesCommand
                {
                    Id          = command.Id,
                    Title       = command.Title,
                    ReleaseDate = command.ReleaseDate,
                    RunningTime = command.RunningTime,
                    IsDeleted   = command.IsDeleted
                };

                return(Request.CreateResponse(HttpStatusCode.OK, _mediator.Send(UpdateMoviesCommand).Result));
            }
            catch (Exception e)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, e.Message));
            }
        }
Ejemplo n.º 2
0
        public async Task <ActionResult> Update(UpdateMoviesCommand command)
        {
            await Mediator.Send(command);

            return(NoContent());
        }