public async Task <ActionResult <PowderShape> > PostPowderShape(PowderShape powderShape)
        {
            _context.PowderShape.Add(powderShape);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPowderShape", new { id = powderShape.Id }, powderShape));
        }
        public async Task <IActionResult> PutPowderShape(int id, PowderShape powderShape)
        {
            if (id != powderShape.Id)
            {
                return(BadRequest());
            }

            _context.Entry(powderShape).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PowderShapeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #3
0
        public ActionResult Edit([Bind(Include = "Id,Name,Notes")] PowderShape modEntity)
        {
            if (ModelState.IsValid)
            {
                this.service.Edit(modEntity);
                return(RedirectToAction("Index"));
            }

            return(View(modEntity));
        }