//Per api instructions don't use .AddAsync() public void AddHero(Hero HeroToAdd) { if (HeroToAdd == null) { throw new ArgumentNullException(nameof(HeroToAdd)); } _context.Add(HeroToAdd); }
//Per api instructions don't use .AddAsync() public void AddProductImage(ProductImage ProductImageToAdd) { if (ProductImageToAdd == null) { throw new ArgumentNullException(nameof(ProductImageToAdd)); } _context.Add(ProductImageToAdd); }
public async Task <IActionResult> Create([Bind("Id,DateUpdated,FileName,ImageThumb,ImageFull")] ProductImage productImage) { if (ModelState.IsValid) { _context.Add(productImage); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(productImage)); }
public async Task <IActionResult> Create([Bind("Id,IsDiscontinued,AssociatedCategoryId,AssociatedSnapshotTypeId,AssociatedGroupId,AssociatedScreenId,AssociatedImageId,AssociatedRecycleId,MerchantNumber,ProductDescription,AiPartNumber,ManufactureNumber,ManufactureName,MfgUrl,MfgManualUrl,AssociatedPrimaryVendorId,AssociatedSecondaryVendorId,AssociatedTertiaryVendorId,Retail,Cost,AdditionalCost,DefaultPriority,IsTaxable,IsRecycleFee,ItemsAssociated,IsExcludedDesAinumOverrwrite,CostVerificationBy")] Product product) { if (ModelState.IsValid) { _context.Add(product); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(product)); }