Пример #1
0
        public async Task <IActionResult> Delete(int lotId)
        {
            var lot = await _repository.Find(lotId, HttpContext.UserId(), HttpContext.User.IsInRole(Constants.AdminRole));

            if (lot != null)
            {
                await _cloudStorage.DeleteFileAsync(lot.ImageUrl);

                await _repository.Delete(lot);

                if (lot.JobId != null)
                {
                    BackgroundJob.Delete(lot.JobId);
                }
            }

            return(RedirectToAction("Index", "Home"));
        }
Пример #2
0
        public async Task DeleteLotAsync(Lot lot)
        {
            if (lot == null)
            {
                throw new ArgumentNullException(nameof(lot));
            }

            _lotRepository.Delete(lot);
            await _unitOfWork.CompleteAsync();
        }
Пример #3
0
 public void DeleteLot(LotEntity entity)
 {
     try
     {
         _lotRepository.Delete(entity.ToDalLot());
         _unitOfWork.Commit();
     }
     catch (Exception exception)
     {
         Log.LogError(exception);
     }
 }
Пример #4
0
        public void RemoveItem(int id)
        {
            Lot lot = _lotRepository.GetById(id);

            _lotRepository.Delete(lot);
        }
 public void DeleteLot(LotEntity lot)
 {
     _lotRepository.Delete(lot.ToDalLot());
     _uow.Commit();
 }