public void Delete(DalBid e) { var bid = e.ToOrmBid(); bid = _context.Set <Bid>().Single(u => u.Id == bid.Id); _context.Set <Bid>().Remove(bid); }
public void Create(DalBid e) { var x = e.ToOrmBid(); _context.Set <Bid>().Add(x); _context.Entry(x).State = EntityState.Added; }
public void Update(DalBid e) { var bid = _context.Set <Bid>().Single(u => u.Id == e.Id); bid.Amount = e.Amount; bid.LotId = e.LotId; bid.Placed = e.Placed; bid.UserId = e.UserId; _context.Entry(bid).State = EntityState.Modified; }
public static Bid ToBid(this DalBid dalBid) { return(new Bid() { BidId = dalBid.Id, LotRefId = dalBid.LotRefId, UserRefId = dalBid.UserRefId, BidAmount = dalBid.BidAmount, BidTime = dalBid.BidTime }); }
public static Bid ToOrmBid(this DalBid bid) { return(new Bid { Id = bid.Id, Amount = bid.Amount, LotId = bid.LotId, Placed = bid.Placed, UserId = bid.UserId }); }
public void Update(DalBid entity) { var updatedBid = entity.ToBid(); var existedBid = _dbContext.Entry <Bid>(_dbContext.Set <Bid>().Find(updatedBid.BidId)); if (existedBid == null) { return; } existedBid.State = EntityState.Modified; //field to update }
public static Bid ToOrmBid(this DalBid dalBid) { Bid newBid = new Bid { Id = dalBid.Id, Price = dalBid.Price, Date = dalBid.Date, LotId = dalBid.LotId, UserId = dalBid.UserId }; return(newBid); }
public static DalBid ToDalBid(this BidEntity bidEntity) { DalBid newBid = new DalBid { Id = bidEntity.Id, Price = bidEntity.Price, Date = bidEntity.Date, LotId = bidEntity.LotId, UserId = bidEntity.UserId }; return(newBid); }
public static BidEntity ToBllBidEntity(this DalBid bid) { return(new BidEntity { Amount = bid.Amount, Id = bid.Id, LotId = bid.LotId, Placed = bid.Placed, UserId = bid.UserId, Lot = bid.Lot.ToBllLotEntity(), User = bid.User.ToBllUserEntity() }); }
public static BidEntity ToBidEntity(this DalBid dalBid) { return(new BidEntity() { Id = dalBid.Id, UserRefId = dalBid.UserRefId, LotRefId = dalBid.LotRefId, LotName = dalBid.LotName, UserLogin = dalBid.UserLogin, BidTime = dalBid.BidTime, BidAmount = dalBid.BidAmount }); }
public static BidEntity ToBllBid(this DalBid dalBid) { return(dalBid == null ? null : new BidEntity { Id = dalBid.Id, Price = dalBid.Price, Date = dalBid.Date, User = dalBid.User.ToBllUser(), Lot = dalBid.Lot.ToBllLot(), LotId = dalBid.LotId, UserId = dalBid.UserId }); }
public static BllBid ToBllBid(this DalBid bid) { if (bid == null) { return(null); } return(new BllBid() { Id = bid.Id, BidDate = bid.DateOfBid, Lot = bid.Lot, Price = bid.Price, User = bid.User, }); }
public static Bid ToOrmBid(this DalBid dalBid) { if (dalBid == null) { return(null); } return(new Bid { Id = dalBid.Id, ProfileId = dalBid.ProfileId, Date = dalBid.Date, Price = dalBid.Price, LotId = dalBid.LotId }); }
public void Create(DalBid entity) { var bid = entity.ToBid(); _dbContext.Set <Bid>().Add(bid); }
public void Delete(DalBid entity) { var bid = entity.ToBid(); _dbContext.Set <Bid>().Remove(bid); }
public void Create(DalBid entity) { _context.Set <Bid>().Add(entity.ToOrmBid()); }
public void Delete(DalBid entity) { var bid = _context.Set <Bid>().Single(b => b.Id == entity.Id); _context.Set <Bid>().Remove(bid); }
public void Update(DalBid entity) { _context.Set <Bid>().AddOrUpdate(entity.ToOrmBid()); }