Ejemplo n.º 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"));
        }
Ejemplo n.º 2
0
        public async Task DeleteLotAsync(Lot lot)
        {
            if (lot == null)
            {
                throw new ArgumentNullException(nameof(lot));
            }

            _lotRepository.Delete(lot);
            await _unitOfWork.CompleteAsync();
        }
Ejemplo n.º 3
0
 public void DeleteLot(LotEntity entity)
 {
     try
     {
         _lotRepository.Delete(entity.ToDalLot());
         _unitOfWork.Commit();
     }
     catch (Exception exception)
     {
         Log.LogError(exception);
     }
 }
Ejemplo n.º 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();
 }