예제 #1
0
        //Per api instructions don't use .AddAsync()
        public void AddHero(Hero HeroToAdd)
        {
            if (HeroToAdd == null)
            {
                throw new ArgumentNullException(nameof(HeroToAdd));
            }

            _context.Add(HeroToAdd);
        }
예제 #2
0
        //Per api instructions don't use .AddAsync()
        public void AddProductImage(ProductImage ProductImageToAdd)
        {
            if (ProductImageToAdd == null)
            {
                throw new ArgumentNullException(nameof(ProductImageToAdd));
            }

            _context.Add(ProductImageToAdd);
        }
예제 #3
0
        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));
        }
예제 #4
0
        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));
        }