Exemplo n.º 1
0
        public async Task <GenreDto> EditGenre(int id, EditGenreCommand command)
        {
            var genre = await this.Find(id);

            genre.Name = command.Name;
            genre      = await this.Update(genre);

            return(genre.ToDto());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(EditGenreCommand Genre)
        {
            await Mediator.Send(Genre);

            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
 public async Task <IHttpActionResult> Update(int id, [FromBody] EditGenreCommand command)
 {
     return(await this.Try(async() => await this._genreRepository.EditGenre(id, command)));
 }