public Character Create(CreateCharacterRequest character) { var CreatedCharacter = _mapper.Map <Character>(character); _chars.Create(CreatedCharacter); return(CreatedCharacter); }
public IActionResult CharacterCreation(CharacterCreationViewModel ccvm) { if (ModelState.IsValid) { Account acc = _ar.GetByName(HttpContext.Session.GetString("Username")); var c = new Character() { Name = ccvm.Name, CharacterModel = ccvm.CharacterModel }; _cr.Create(c, acc); return(RedirectToAction("Characters")); } else { ccvm.CharModels = _cr.GetAllCharModels(); return(View(ccvm)); } }