コード例 #1
0
        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);
        }
コード例 #2
0
 public Playlist GetById(long id)
 {
     return(_playlistRepository.Get(id));
 }
コード例 #3
0
 private Task <Playlist> GetPlaylist()
 {
     return(_playlistRepository.Get(_testOptions.TestPlaylistId));
 }