예제 #1
0
        public Character Create(CreateCharacterRequest character)
        {
            var CreatedCharacter = _mapper.Map <Character>(character);

            _chars.Create(CreatedCharacter);

            return(CreatedCharacter);
        }
예제 #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));
     }
 }