public void Update(DalLot e)
 {
     var lot = _context.Set<Lot>().Single(u => u.Id == e.Id);
     lot.Id = e.Id;
     lot.BuyOutBet = e.BuyOutBet;
     lot.CreatedByUserId = e.CreatedByUserId;
     lot.EndDate = e.EndDate;
     lot.LotClosed = e.LotClosed;
     lot.LotEnded = e.LotEnded;
     lot.LotDescription = e.LotDescription;
     lot.Name = e.Name;
     lot.LotPicture = e.LotPicture;
     lot.LotPicturePreview = e.LotPicturePreview;
     lot.MinimalBet = e.MinimalBet;
     _context.Entry(lot).State = EntityState.Modified;
 }
 public void Delete(DalLot e)
 {
     var lot = e.ToOrmLot();
     lot = _context.Set<Lot>().Single(u => u.Id == lot.Id);
     _context.Set<Lot>().Remove(lot);
 }
        public void Create(DalLot e)
        {

            _context.Set<Lot>().Add(e.ToOrmLot());
        }
 public void CloseLot(DalLot lot)
 {
     var ormlot = _context.Set<Lot>().Single(u => u.Id == lot.Id);
     ormlot.LotClosed = true;
     _context.Entry(ormlot).State = EntityState.Modified;
 }
 public void Update(DalLot entity)
 {
     var updatedLot = entity.ToLot();
     var existedLot = _dbContext.Entry<Lot>(_dbContext.Set<Lot>().Find(updatedLot.LotId));
     if (existedLot == null)
     {
         return;
     }
     existedLot.State = EntityState.Modified;
     existedLot.Entity.BlockReason = entity.BlockReason;
     existedLot.Entity.IsBlocked = entity.IsBlocked;
     existedLot.Entity.IsConfirm = entity.IsConfirm;
     existedLot.Entity.IsSold = entity.IsSold;
     existedLot.Entity.CategoryRefId = entity.CategoryRefId;
     existedLot.Entity.LotName = entity.LotName;
     existedLot.Entity.Discription = entity.Discription;
     existedLot.Entity.EndDate = entity.EndDate;
 }
 public void Create(DalLot entity)
 {
     var lot = entity.ToLot();
     _dbContext.Set<Lot>().Add(lot);
 }
 public void Delete(DalLot entity)
 {
     var lot = entity.ToLot();
     lot = _dbContext.Set<Lot>().Single(l => l.LotId == lot.LotId);
     _dbContext.Set<Lot>().Remove(lot);
 }