public void Consume(RiskLevelUntagPlayer @event) { var entity = _repository.PlayerRiskLevels.SingleOrDefault(x => x.Id == @event.Id); if (entity != null) { _repository.PlayerRiskLevels.Remove(entity); _repository.SaveChanges(); } }
public void Handle(RiskLevelUntagPlayer @event) { var bonusRepository = _container.Resolve <IBonusRepository>(); var player = bonusRepository.Players.FirstOrDefault(x => x.Id == @event.PlayerId); if (player == null) { throw new RegoException(string.Format(NoPlayerFormat, @event.PlayerId)); } var riskLevel = player.RiskLevels.FirstOrDefault(rl => rl.Id == @event.RiskLevelId); if (riskLevel == null) { throw new RegoException($"Player (Id: {@event.PlayerId}) is not tagged by risk level Id: {@event.RiskLevelId}"); } player.RiskLevels.Remove(riskLevel); bonusRepository.SaveChanges(); }
public void Consume(RiskLevelUntagPlayer message) { _eventHandlers.Handle(message); }
public void Consume(RiskLevelUntagPlayer message) { _fraudSubscriber.Handle(message); }
public void Handle(RiskLevelUntagPlayer @event) { AddActivityLog(AdminActivityLogCategory.FraudRiskLevel, @event); }