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")); }
public async Task DeleteLotAsync(Lot lot) { if (lot == null) { throw new ArgumentNullException(nameof(lot)); } _lotRepository.Delete(lot); await _unitOfWork.CompleteAsync(); }
public void DeleteLot(LotEntity entity) { try { _lotRepository.Delete(entity.ToDalLot()); _unitOfWork.Commit(); } catch (Exception exception) { Log.LogError(exception); } }
public void RemoveItem(int id) { Lot lot = _lotRepository.GetById(id); _lotRepository.Delete(lot); }
public void DeleteLot(LotEntity lot) { _lotRepository.Delete(lot.ToDalLot()); _uow.Commit(); }