public ActionResult Create(ProductsViewModel model)
 {
     if (ModelState.IsValid)
     {
         int currentUserId = userService.GetByPredicate(u => u.Login == User.Identity.Name).FirstOrDefault().Id;
         var product = new ProductEntity()
         {
             Auction_Cost = model.Auction_Cost,
             AuctionStart = DateTime.Now,
             AuctionEnd = model.AuctionEnd,
             Description = model.Description,
             Seller_Id = currentUserId,
             Customer_Id = currentUserId
         };
         service.Create(product);
         return RedirectToAction("Index");
     }
     return View(model);
 }
 public void Delete(ProductEntity entity)
 {
     productRepository.Delete(entity.ToDalProduct());
     uow.Commit();
 }
 public void Edit(ProductEntity entity)
 {
     productRepository.Update(entity.ToDalProduct());
     uow.Commit();
 }