public async Task <ActionResult <PrimerType> > PostPrimerType(PrimerType primerType)
        {
            _context.PrimerType.Add(primerType);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetPrimerType", new { id = primerType.Id }, primerType));
        }
Beispiel #2
0
 private void primer1ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     currentCheckedItemPrimer.Checked = false;
     primerType = PrimerType.Primer1;
     currentCheckedItemPrimer         = primer1ToolStripMenuItem;
     currentCheckedItemPrimer.Checked = true;
 }
        public async Task <IActionResult> PutPrimerType(int id, PrimerType primerType)
        {
            if (id != primerType.Id)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
        public ActionResult Edit([Bind(Include = "Id,Name,Abbreviation,Notes")] PrimerType entity)
        {
            if (ModelState.IsValid)
            {
                this.service.Edit(entity);
                return(RedirectToAction("Index"));
            }

            return(View(entity));
        }