public void Create(GalleryImage image) { if (image != null) { Context.GalleryImages.Add(image); } }
public ActionResult AddToGallery(CreateImageViewModel model) { if (SaveScreenshot(model)) { var product = ProductManager.FindById(model.ProductId); var img = new GalleryImage { Product = product, ImageLocation = model.ImageUrl, ImageThumb = model.ImageThumbUrl }; product.GalleryImages.Add(img); MultimediaManager.Create(img); MultimediaManager.Save(); } return ManageImages(model.ProductId); }