public ActionResult Create(Auction auction)
        {
            if (ModelState.IsValid)
            {
                var db = new EbuyDataContext();
                db.Auctions.Add(auction);
                db.SaveChanges();

                return(RedirectToAction("Details", new { id = auction.Id }));
            }

            return(View(auction));
        }
		public ActionResult Create(Auction auction)
		{
			if (ModelState.IsValid)
			{
				var db = new EbuyDataContext();
				auction.CurrentPrice = auction.StartPrice;
				db.Auctions.Add(auction);
				db.SaveChanges();

				return RedirectToAction("Details", new { id = auction.Key });
			}

			return View(auction);
		}
 public ActionResult Create(Auction auction)
 {
     try
     {
         if (ModelState.IsValid)
         {
             // TODO: Add insert logic here
             var db = new EbuyDataContext();
             db.Auctions.Add(auction);
             db.SaveChanges();
             return(View(auction));
         }
         return(RedirectToAction("Index"));
     }
     catch (Exception e)
     {
         return(View());
     }
 }