public async Task <IActionResult> Edit(int id, [Bind("LanternId,LanternName,LanternType")] Lanterns lanterns) { if (id != lanterns.LanternId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(lanterns); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LanternsExists(lanterns.LanternId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(lanterns)); }
public Caravel_Lantern(CaravelInterface newShip) : base(newShip) { //currently uses new keyword, but because Plating is a unity MonoBehavior, throws console a warning (not sure how to fix) Lanterns newLanterns = new Lanterns(); newLanterns.AddLanterns(); }
public async Task <IActionResult> Create([Bind("LanternId,LanternName,LanternType")] Lanterns lanterns) { if (ModelState.IsValid) { _context.Add(lanterns); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(lanterns)); }