public async Task <int> AddProduct(NewProductVM product)//do poprawy { var model = _mapper.Map <Product>(product); model.Ammount = new Ammount() { Quantity = product.Ammount }; List <string> images = _imageRepository.AddPathToPhoto(product.Images); for (int i = 0; i < images.Count; i++) { var item = new Image() { Path = images[i] }; model.Paths.Add(item); } int id = await _productManager.CreateProduct(model); return(id); }