예제 #1
0
        public async Task AddPlayer(InnerGameModel gameData, int id)
        {
            var dtoToEntities  = new DTOToEntities();
            var modelViewToDto = new ModelViewToDTO();
            var playerDto      = new UserDTO()
            {
                GameId = id
            };

            modelViewToDto.GetPlayerDto(gameData, playerDto);
            await _userRepository.CreateAsync(dtoToEntities.GetPlayer(playerDto));
        }
예제 #2
0
 public async Task AddPlayer(InnerGameViewModel gameData, int id)
 {
     try
     {
         var playerDto = new UserDTO();
         playerDto.GameId = id;
         _modelViewToDto.GetPlayerDto(gameData, playerDto);
         await _userRepository.CreateAsync(_dtoToEntities.GetPlayer(playerDto));
     }
     catch (Exception e)
     {
         LogWriter.WriteLog(e.Message, "CreateGameService");
     }
 }