Exemple #1
0
        public async Task <IActionResult> Delete(string moniker, int id)
        {
            try
            {
                var track = await _repo.GetTrackAsync(moniker, id);

                _repo.Delete(track);
                await _repo.SaveChangesAsync();

                return(Ok());
            }
            catch (Exception ex)
            {
                _logger.LogError("Failed to delete a track: {0}", ex);
            }

            return(BadRequest("Failed to delete Track"));
        }