public async Task <IActionResult> Create([Bind("WeaponId,Name,Description,Price,Weight,Type,Range,ClipSize,FireRate")] Weapon weapons)
        {
            if (ModelState.IsValid)
            {
                _context.Add(weapons);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(weapons));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("ArmorId,Name,Description,Price,Weight,Type,Dexterity,KineticBarrier,MediGelCapacity")] Armor armor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(armor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(armor));
        }
        public async Task <IActionResult> Create([Bind("ShipId,Name,Description,Price,Ftl,Type,ArmorType,KineticBarrier")] Ship ships)
        {
            if (ModelState.IsValid)
            {
                _context.Add(ships);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(ships));
        }