Exemple #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));
            }
        }
        public async Task <ActionResult> Update(UpdateMoviesCommand command)
        {
            await Mediator.Send(command);

            return(NoContent());
        }