Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
    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();
    }
Exemplo n.º 3
0
        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));
        }