Ejemplo n.º 1
0
 public void AuctionTestInitialize()
 {
     Console.Out.Write("AuctionTestInitialize called...");
     _auctionRepository = new AuctionRepository();
     _artworkRepository = new ArtworkRepository();
     _bidRepository = new BidRepository();
     _auction = new Auction();
 }
Ejemplo n.º 2
0
        public static Auction ConvertToBusinessModel(this AuctionViewModel model)
        {
            var auction = new Auction
                          {
                              Artwork = model.Artwork,
                              Expires = model.Expires,
                              Interval = model.Interval,
                              MinPrice = model.MinPrice
                          };

            return auction;
        }
Ejemplo n.º 3
0
 public void InsertAuction(Auction auction)
 {
     db.Entry(auction.Artwork).State = EntityState.Unchanged;
     db.Auctions.Add(auction);
     db.SaveChanges();
 }
Ejemplo n.º 4
0
 public void DisableAuction(Auction auction)
 {
     db.Auctions.Add(auction).Active = false;
     db.SaveChanges();
 }
Ejemplo n.º 5
0
 public void DeleteAuction(Auction auction)
 {
     db.Auctions.Remove(auction);
     db.SaveChanges();
 }
Ejemplo n.º 6
0
 public IQueryable<Bid> GetAllBidsByAuction(Auction auction)
 {
     return db.Bids.Include(x => x.User).Include(x => x.Auction).Where(x => x.Auction.Id == auction.Id);
 }