コード例 #1
0
        public async Task <ActionResult> SkillAddConfirmation([Bind] AgentToSkill agentToSkill)
        {
            logger.Info($"Action Start | Controller name: {nameof(AgentsController)} | Action name: {nameof(SkillAddConfirmation)} | Input params: {nameof(agentToSkill.AgentId)}={agentToSkill.AgentId}, {nameof(agentToSkill.SkillId)}={agentToSkill.SkillId}, {nameof(agentToSkill.Level)}={agentToSkill.Level}, {nameof(agentToSkill.OrderIndex)}={agentToSkill.OrderIndex}, {nameof(agentToSkill.BreakingMode)}={agentToSkill.BreakingMode}, {nameof(agentToSkill.Percent)}={agentToSkill.Percent}");

            if (ModelState.IsValid)
            {
                repository.CreateAgentToSkill(agentToSkill);
                await repository.SaveAsync();

                return(RedirectToAction("AgentSkills", new { id = agentToSkill.AgentId }));
            }
            return(View(agentToSkill));
        }