public ActionResult Index(ProductModel model, HttpPostedFileBase image)
 {
     if (image != null)
     {
         model.ImageMimeType = image.ContentType;
         model.ImageData = new byte[image.ContentLength];
         image.InputStream.Read(model.ImageData, 0, image.ContentLength);
     }
     _productDataAccess.AddNewEntity(model);
     return View();
 }
 public void UpdateEntity(ProductModel obj)
 {
     throw new System.NotImplementedException();
 }
 public int AddNewEntity(ProductModel obj)
 {
     var product = Mapper.Map<ProductModel, Product>(obj);
     return _repository.AddNewEntity(product);
 }