/// <summary> /// Deprecated Method for adding a new object to the ProductImage EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToProductImage(ProductImage productImage) { base.AddObject("ProductImage", productImage); }
/// <summary> /// Create a new ProductImage object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="default">Initial value of the Default property.</param> /// <param name="imageSource">Initial value of the ImageSource property.</param> /// <param name="productId">Initial value of the ProductId property.</param> public static ProductImage CreateProductImage(global::System.Int32 id, global::System.Boolean @default, global::System.String imageSource, global::System.Int32 productId) { ProductImage productImage = new ProductImage(); productImage.Id = id; productImage.Default = @default; productImage.ImageSource = imageSource; productImage.ProductId = productId; return productImage; }
private void DeleteImage(ProductImage image, ShopContainer context) { IOHelper.DeleteFile("~/Content/Images", image.ImageSource); foreach (var folder in GraphicsHelper.ThumbnailFolders) { IOHelper.DeleteFile("~/ImageCache/" + folder, image.ImageSource); } //IOHelper.DeleteFile("~/ImageCache/thumbnail0", image.ImageSource); //IOHelper.DeleteFile("~/ImageCache/thumbnail1", image.ImageSource); context.DeleteObject(image); }