public ActionResult NewAccessoryLot(NewAccessoryLotModel model)
 {
     if (ModelState.IsValid)
     {
         using (var db = new BGS_DBContext()) {
             string userIdentityId = User.Identity.GetUserId();
             var    seller         = db.Users.Single(u => u.Id == userIdentityId);
             for (int i = 0; i < model.LotCount; i++)
             {
                 AccessoryModel newAccessoryModelModel = GameUtilCreater.AccessoryModelFromModel(model);
                 db.AccessoryModels.Add(newAccessoryModelModel);
                 db.SaveChanges();
                 var lot = new LotModel()
                 {
                     Seller   = seller,
                     ItemId   = newAccessoryModelModel.Id,
                     Price    = model.Price,
                     SellerId = seller.GameId,
                     Status   = LotStatus.Available,
                     Type     = LotType.Accessory
                 };
                 db.LotModels.Add(lot);
                 db.SaveChanges();
                 newAccessoryModelModel.LotId = lot.Id;
             }
             db.SaveChanges();
             return(RedirectToAction("Index", "Market"));
         }
     }
     ModelState.AddModelError("", "Что то не правильно");
     return(View(model));
 }
        public ActionResult NewAccessoryLot()
        {
            var model = new NewAccessoryLotModel();

            return(View(model));
        }