Beispiel #1
0
        public async Task <PlayListDto> CreatAsync(PlayListDto item)
        {
            var result = _context.PlayLists.Add(
                PlayListConverter.Convert(item));
            await _context.SaveChangesAsync();

            return(PlayListConverter.Convert(result.Entity));
        }
Beispiel #2
0
        public async Task <bool> UpdateAsync(PlayListDto item)
        {
            if (item == null)
            {
                return(false);
            }
            _context.PlayLists.Update(PlayListConverter.Convert(item));
            await _context.SaveChangesAsync();

            return(true);
        }
Beispiel #3
0
 public async Task <PlayListDto> GetById(Guid id)
 {
     return(PlayListConverter.Convert(await _context.PlayLists.FindAsync(id)));
 }
Beispiel #4
0
 public async Task <List <PlayListDto> > GetAllPlayList()
 {
     return(PlayListConverter.Convert(await _context.PlayLists.ToListAsync()));
 }