public async Task <IActionResult> CreateHero(HeroToCreateDto dto) { var mappedHero = _mapper.Map <HeroToCreateDto, Heroes>(dto); var heroId = await _repo.CreateHero(mappedHero); var mappedHeroExt = _mapper.Map <HeroToCreateDto, HeroesExtended>(dto); mappedHeroExt.HeroId = heroId; var heroCreated = await _repo.CreateHeroExt(mappedHeroExt); return(Ok(heroCreated)); }
public void TestMethod1() { var hero = new Heroes(); var heroToCreate = new HeroToCreateDto { Name = "Burriticus", ArmorClass = 22, CurrentHp = 30, MaxHp = 30, Condition1 = null, Condition2 = null, Condition3 = null, Condition4 = null }; var mappedHero = _mapper.Map <HeroesExtended>(heroToCreate); }