public async Task <IActionResult> Add(AddSkillInputModel model) { var heroInfoId = HeroId; await this.skillsService.AddSkillAsync(model, heroInfoId); return(this.Redirect("/Heroes/All")); }
public async Task AddSkillAsync(AddSkillInputModel model, int heroId) { var skill = new Skill { Name = model.Name, Image = model.Image, Description = model.Description, Ability = model.Ability, DamageType = model.DamageType, PierceSpellImmunity = model.PierceSpellImmunity, Affects = model.Affects, Cooldown = model.Cooldown, ManaCost = model.ManaCost, HeroInfoId = heroId, }; var id = heroId; await this.skillsRepository.AddAsync(skill); await this.skillsRepository.SaveChangesAsync(); }