public void ClaimBonusRedemption(ClaimBonusRedemption model) { using (var scope = CustomTransactionScope.GetTransactionScope()) { var validationResult = _bonusQueries.GetValidationResult(model); if (validationResult.IsValid == false) { throw new RegoException(validationResult.Errors.First().ErrorMessage); } var redemption = _repository.GetBonusRedemption(model.PlayerId, model.RedemptionId); ClaimBonusRedemption(redemption); _repository.SaveChanges(); redemption.Events.ForEach(_eventBus.Publish); scope.Complete(); } }
public BonusRedemption GetBonusRedemption(Guid playerId, Guid redemptionId) { var redemption = _repository.GetBonusRedemption(playerId, redemptionId).Data; return(Mapper.Map <BonusRedemption>(redemption)); }