コード例 #1
0
 public void Remove(Lot lot)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Entry <Lot>(lot).State = EntityState.Deleted;
         auctionContext.SaveChanges();
     }
 }
コード例 #2
0
 public void Edit(Lot lot)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Entry <Lot>(lot).State = EntityState.Modified;
         auctionContext.SaveChanges();
     }
 }
コード例 #3
0
 public void Add(Lot lot)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Lots.Add(lot);
         auctionContext.SaveChanges();
     }
 }
コード例 #4
0
 public void Registartion(User user)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Users.Add(user);
         auctionContext.SaveChanges();
     }
 }
コード例 #5
0
 public void Edit(User user)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         auctionContext.Entry <User>(user).State = EntityState.Modified;
         auctionContext.SaveChanges();
     }
 }
コード例 #6
0
 public void Buy(User user, Lot lot)
 {
     using (AuctionContext auctionContext = new AuctionContext())
     {
         lot.Buyer   = user;
         lot.IdBuyer = user.Id;
         auctionContext.Entry <Lot>(lot).State = EntityState.Modified;
         auctionContext.SaveChanges();
     }
 }