public async Task <ServiceResult <PlaylistModel> > Get(string id)
        {
            var serviceResult = new ServiceResult <PlaylistModel>();
            var result        = await _playlistRepository.Get(id);

            if (result.Success)
            {
                serviceResult.Success = true;
                serviceResult.Result  = result.Entity;
            }
            else
            {
                serviceResult.Error.Code        = ErrorStatusCode.BudRequest;
                serviceResult.Error.Description = result.Message;
            }
            return(serviceResult);
        }
Exemple #2
0
 public Playlist GetById(long id)
 {
     return(_playlistRepository.Get(id));
 }
Exemple #3
0
 private Task <Playlist> GetPlaylist()
 {
     return(_playlistRepository.Get(_testOptions.TestPlaylistId));
 }