Exemplo n.º 1
0
        public Task UpdateFavoriteAsync(string id, UpdateMusicRequest request)
        {
            FilterDefinition <MusicDocument> filter = MusicQueryBuilder.BuildEntityIdQuery(id: id);
            UpdateDefinition <MusicDocument> update = MusicQueryBuilder.BuildUpdateQuery(query: request);

            return(base.UpdateAsync(filter: filter, update: update));
        }
Exemplo n.º 2
0
        public Task <List <MusicDocument> > SearchMusicAsync(SearchMusicRequest request)
        {
            FilterDefinition <MusicDocument> filter = MusicQueryBuilder.BuildSearchQuery(query: request);

            if (!string.IsNullOrEmpty(request.SortBy))
            {
                SortDefinition <MusicDocument> sort = MusicQueryBuilder.BuildSortQuery(sortBy: request.SortBy);
                return(base.FindAsync(filter, sort));
            }

            return(base.FindAsync(filter));
        }
Exemplo n.º 3
0
        public Task RemoveMusicAsync(string id)
        {
            FilterDefinition <MusicDocument> filter = MusicQueryBuilder.BuildEntityIdQuery(id: id);

            return(base.RemoveOneAsync(filter));
        }
Exemplo n.º 4
0
        public Task <MusicDocument> GetMusicAsync(string id)
        {
            FilterDefinition <MusicDocument> filter = MusicQueryBuilder.BuildEntityIdQuery(id: id);

            return(base.FindByAsync(filter: filter));
        }