示例#1
0
        public ActionResult <ChampionDto> CreateChampion(CreateChampionDto createChampionDto)
        {
            var champ = new Champion
            {
                Id       = Guid.NewGuid(),
                Name     = createChampionDto.Name,
                Ultimate = createChampionDto.Ultimate
            };

            this.championDao.CreateChampion(champ);

            return(CreatedAtAction(nameof(GetChampion), new
            {
                Id = champ.Id
            }, champ.AsDto()));
        }