Beispiel #1
0
        public string CreateProductFullPath(ref ProductViewModel product)
        {
            var filepath = string.IsNullOrEmpty(product.ImageUrl)
                ? "/content/files/" + Guid.NewGuid() + ".png"
                : product.ImageUrl;

            var fullPath = HostingEnvironment.MapPath(filepath);

            if (System.IO.File.Exists(fullPath))
            {
                System.IO.File.Delete(fullPath);
            }

            productOperations.AddImagePathToProduct(ref product, filepath);

            return(fullPath);
        }