public ActionResult CreateWeapon(Weapon weapon) { if (!ModelState.IsValid) { return(View("Create")); } weaponRepository = new WeaponRepository(); weaponRepository.Create(weapon); return(RedirectToAction("Weapons")); }
public ActionResult Create(WeaponViewModel ReturnedWeapon) { Weapon CreatedWeapon = new Weapon() { ID = ReturnedWeapon.ID, Name = ReturnedWeapon.Name, Damage = ReturnedWeapon.Damage, Magazine = ReturnedWeapon.Magazine, Critical = ReturnedWeapon.Critical, Status = ReturnedWeapon.Status }; weapon.Create(CreatedWeapon); return(RedirectToAction("Weapons")); }