public async Task <ActionResult <ArtistaViewModel> > Add(ArtistaViewModel artistaViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(CustomResponse(ModelState));
            }

            await _artistaService.Adicionar(_mapper.Map <Artista>(artistaViewModel));

            return(CustomResponse(artistaViewModel));
        }
        public async Task <IActionResult> Adicionar(ArtistaViewModel artistaViewModel)
        {
            await _artistaService.Adicionar(_mapper.Map <Artista>(artistaViewModel));

            await Commit(_artistaRepository);

            if (!OperacaoValida())
            {
                return(CustomBadRequest());
            }

            return(CreatedAtRoute("ArtistaPorId", new { id = artistaViewModel.Id }, artistaViewModel));
        }
        public async Task <IActionResult> Cadastrar(ArtistaViewModel artistaViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(artistaViewModel));
            }

            var artistaResponse = await _artistaService.Adicionar(artistaViewModel);

            if (ResponsePossuiErros(artistaResponse.ResponseResult))
            {
                return(View(artistaResponse));
            }

            return(RedirectToAction("Index"));
        }