public async Task <ActionResult <Eis> > PostEis(Eis eis) { _context.Eis.Add(eis); await _context.SaveChangesAsync(); return(CreatedAtAction("GetEis", new { id = eis.Id }, eis)); }
public async Task <IActionResult> PutEis(int id, Eis eis) { if (id != eis.Id) { return(BadRequest()); } _context.Entry(eis).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EisExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Preis,MilchEis")] Eis eis) { if (id != eis.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(eis); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EisExists(eis.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(eis)); }
public async Task <IActionResult> Create([Bind("Id,Name,Preis,MilchEis")] Eis eis) { if (ModelState.IsValid) { _context.Add(eis); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(eis)); }
public ActionResult Delete(int id, Eis eis) { try { data.Delete(eis); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Create(Eis eis) { try { data.Add(eis); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Edit(int id, Eis eis) { try { data.UpdateEis(eis); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public ActionResult Delete(int id, Eis eis) { try { // TODO: Add delete logic here data.DeleteEis(eis); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public void Put(int id, [FromBody] Eis value) { data.Update(value); }
public void Post([FromBody] Eis value) { data.Add(value); }
public void Put(int id, [FromBody] Eis eis) { data.UpdateEis(eis); }
public void Post([FromBody] Eis eis) { data.AddEis(eis); }