public async Task <ActionResult <MusicRessource> > CreateMusic(SaveMusicRessource saveMusicRessource)
        {
            try
            {
                //======Validation =====
                var validation       = new SaveMusicRessourceValidator();
                var validationResult = await validation.ValidateAsync(saveMusicRessource);

                if (!validationResult.IsValid)
                {
                    return(BadRequest(validationResult.Errors));
                }
                // mappage
                var music = _mapperService.Map <SaveMusicRessource, Music>(saveMusicRessource);
                // Creation Music
                var newMusic = await _musicServices.CreateMusic(music);

                // mappage
                var musicRessources = _mapperService.Map <Music, MusicRessource>(newMusic);

                return(Ok(musicRessources));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
        public async Task <ActionResult <MusicRessource> > UpdateMusic(int id, SaveMusicRessource saveMusicRessource)
        {
            // validation
            var validation       = new SaveMusicRessourceValidator();
            var validationResult = await validation.ValidateAsync(saveMusicRessource);

            if (!validationResult.IsValid)
            {
                return(BadRequest(validationResult.Errors));
            }
            // Verifier existance de l'objet Music
            var music = await _musicServices.GetMusicById(id);

            if (music == null)
            {
                return(BadRequest("Music n'existe pas"));
            }
            //mappage
            var musicUpdate = _mapperService.Map <SaveMusicRessource, Music>(saveMusicRessource);
            // update Music
            await _musicServices.UpdateMusic(music, musicUpdate);

            //===mappageNewMusicRessource
            var musicUpdateNew = await _musicServices.GetMusicById(id);

            var musicUpdateNewRessource = _mapperService.Map <Music, MusicRessource>(musicUpdateNew);

            return(Ok(musicUpdateNewRessource));
        }