Exemplo n.º 1
0
        public async Task EditMonster(MonsterInputModel inputModel)
        {
            Monster monster = this.mapper.Map <Monster>(inputModel);

            this.context.Monsters.Update(monster);
            await this.context.SaveChangesAsync();
        }
        public async Task <IActionResult> Edit(MonsterInputModel inputModel)
        {
            await this.monsterService.EditMonster(inputModel);

            return(this.RedirectToAction("Index"));
        }
        public async Task <IActionResult> Edit(int id)
        {
            MonsterInputModel inputModel = await this.monsterService.GetMonsterInputModelById(id);

            return(this.View(inputModel));
        }