Exemplo n.º 1
0
        public Character Create(CreateCharacterRequest character)
        {
            var CreatedCharacter = _mapper.Map <Character>(character);

            _chars.Create(CreatedCharacter);

            return(CreatedCharacter);
        }
Exemplo n.º 2
0
 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));
     }
 }