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)); }
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"); } }