public async Task <bool> UpdateCoverAsync(UpdateCoverCommand command) { var movie = await _repository.SingleOrDefaultAsync(x => x.ID == command.ID, tracking : false); Guard.Against(movie, ErrorType.NotFound); var filePath = await _fileManagerService.CreateCoverImageAsync(command.Image, command.ID); movie.ImagePath = filePath; _repository.Update(movie); return(await CommitAsync() > 0); }
public async Task <IActionResult> UpdateCoverAsync([FromForm] UpdateCoverCommand command) { return(Ok(await _movieService.UpdateCoverAsync(command))); }