Exemple #1
0
 [HttpPost]  //Создание нового
 public async Task <IActionResult> Post([FromBody] PlaylistDto item)
 {
     try
     {
         return(Ok(await _playRepo.CreateAsync(item)));
     }
     catch (Exception ex)
     {
         return(StatusCode(500, ex));
     }
 }
Exemple #2
0
 public Task <Playlist> CreateAsync(Playlist playlist,
                                    CancellationToken cancel = default)
 {
     return(_playlistRepository.CreateAsync(playlist, cancel));
 }