Пример #1
0
        public GameService(IGameRepository gameRepository,
                           IPlayerRepository playerRepository,
                           IRoundPlayerRepository roundRepository,
                           ICardRepository cardRepository,
                           IRoundPlayerCardRepository roundCardRepository,
                           IHttpContextAccessor httpContextAccessor)
        {
            _gameRepository            = gameRepository;
            _playerRepository          = playerRepository;
            _roundPlayerRepository     = roundRepository;
            _cardRepository            = cardRepository;
            _roundPlayerCardRepository = roundCardRepository;
            string playerIdClaimValue = httpContextAccessor.HttpContext.User.FindFirst(Constants.ClaimPlayerId).Value;

            if (!string.IsNullOrEmpty(playerIdClaimValue))
            {
                _userId = long.Parse(playerIdClaimValue);
            }
        }
Пример #2
0
 public CardService(IRoundPlayerCardRepository roundPlayerCardRepository,
                    ICardRepository cardRepository)
 {
     _roundPlayerCardRepository = roundPlayerCardRepository;
     _cardRepository            = cardRepository;
 }