Ejemplo n.º 1
0
        public CharacterDataModel RequestToDataModel(CharacterCreateRequest request)
        {
            List <CharacterLvlDataModel> characterLvls = new List <CharacterLvlDataModel>
            {
                _lvlConverter.RequestToDataModel(LvlType.combat),
                _lvlConverter.RequestToDataModel(LvlType.crafting),
                _lvlConverter.RequestToDataModel(LvlType.gathering)
            };

            CharacterDataModel character = new CharacterDataModel()
            {
                Name           = request.Name,
                ImgUrl         = request.imageUrl,
                CharacterClass = (CharacterClassType)request.CharacterClass,
                Money          = 0,
                UserId         = request.UserId,
                CharacterLvls  = characterLvls
            };

            return(character);
        }
Ejemplo n.º 2
0
        public bool Create(CharacterCreateRequest request)
        {
            CharacterDataModel character = _converter.RequestToDataModel(request);

            return(_repository.Create(character));
        }