Example #1
0
        public async Task <MusicResponse> AddMusicAsync(MusicAddRequest request)
        {
            this._validationService.ThrowIfInvalid(request: request);

            MusicDocument doc = MusicMongoMapper.Map(request: request);

            return(MusicMapper.Map(await this._musicRepo.AddMusicAsync(doc)));
        }
Example #2
0
        public async Task <MusicResponse> GetMusicAsync(string id)
        {
            MusicDocument music = await this._musicRepo.GetMusicAsync(id : id);

            return(MusicMapper.Map(music: music));
        }
Example #3
0
        public async Task <List <MusicResponse> > SearchMusicAsync(MusicSearchRequest request)
        {
            List <MusicDocument> musics = await this._musicRepo.SearchMusicAsync(request : request.ToDataLayer());

            return(MusicMapper.Map(musics: musics));
        }