Beispiel #1
0
 public void Delete(int id)
 {
     using (_trackRepository)
     {
         _trackRepository.Delete(id);
         _trackRepository.SaveChanges();
     }
 }
Beispiel #2
0
        private async Task DeleteTrack()
        {
            var track = await _trackRepository.Get(CreateTrack());

            if (track != null)
            {
                await _trackRepository.Delete(track);
            }
        }
Beispiel #3
0
        public async Task <IActionResult> Delete(long id)
        {
            var post = await _repo.GetTrack(id);

            if (post == null)
            {
                return(new NotFoundResult());
            }
            await _repo.Delete(id);

            return(new OkResult());
        }
 public ActionResult Delete(int id, IFormCollection collection)
 {
     try
     {
         trackRepository.Delete(id);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
Beispiel #5
0
        public bool Delete(int ID)
        {
            var opSuccess = _trackRepository.Delete(ID).Result;

            if (!opSuccess)
            {
                _logger.LogInformation("Failed to delete track.");
                return(opSuccess);
            }

            _logger.LogInformation("Deleted track.");
            return(opSuccess);
        }
Beispiel #6
0
        /// <inheritdoc />
        public override async Task Delete(Episode obj)
        {
            if (obj == null)
            {
                throw new ArgumentNullException(nameof(obj));
            }

            _database.Entry(obj).State = EntityState.Deleted;
            await obj.Tracks.ForEachAsync(x => _tracks.Delete(x));

            obj.ExternalIDs.ForEach(x => _database.Entry(x).State = EntityState.Deleted);
            await _database.SaveChangesAsync();
        }
Beispiel #7
0
        public async Task <IActionResult> Delete(int id)
        {
            var isThere = await repository.Delete(id);

            if (isThere)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }
Beispiel #8
0
        public async Task <IActionResult> Delete(int id)
        {
            var track = await _repository.Find(id);

            if (track == null)
            {
                return(NotFound());
            }

            var update = await _repository.Delete(track.Id);

            if (!update)
            {
                return(NotFound());
            }
            return(Ok());
        }
Beispiel #9
0
 public Track Delete(int id)
 {
     return(_trackRepository.Delete(id));
 }
Beispiel #10
0
        public async Task <bool> UntrackMovie(TrackedMovie model)
        {
            var result = await _trackRepository.Delete(model);

            return(result > 0);
        }
Beispiel #11
0
 public bool Delete(int id)
 {
     return(Context.Delete(id));
 }
Beispiel #12
0
 private async Task DeleteTracks(List <Track> tracksToDelete)
 {
     await _trackRepository.Delete(tracksToDelete);
 }