public static async Task <long> AddProductImage(productimage image) { using (var db = new VendorsConfigEntities()) { db.productimages.Add(image); await db.SaveChangesAsync(); return(image.Id); } }
private async Task InsertProductImages(IList <string> rowValues, long vendorProductId) { foreach (var imageConfig in _imagefileconfig) { var image = new productimage { ImagePath = rowValues[(int)imageConfig.ColumnNo], ImageType = imageConfig.ImageType, VendorProductId = vendorProductId }; await VendorsConfig.AddProductImage(image); } }
private async Task InsertProductImages(long vendorProductId, int row) { foreach (var imageConfig in _imagefileconfig) { var image = new productimage { ImagePath = Convert.ToString((_range.Cells[row, (imageConfig.ColumnNo + 1)] as Range).Value2), ImageType = imageConfig.ImageType, VendorProductId = vendorProductId }; await VendorsConfig.AddProductImage(image); } }
private void addProductImage(string fileName, string eisSku, int order, string caption, string imageType, bool isPush = false) { var productImage = new productimage { EisSKU = eisSku, Caption = caption, FileName = fileName, ImageType = imageType, Order_ = order }; _context.productimages.Add(productImage); if (!isPush) { _context.SaveChanges(); } }