public ValidationResult ValidateBonusType(string bonusType, bool validateIfStakeable = false) { var validationResult = new ValidationResult(); var type = _bonusTypeService.GetAsync(bonusType).GetAwaiter().GetResult(); if (type == null) { validationResult.Add($"Condition Type {bonusType} is not a valid Type"); return(validationResult); } if (!type.IsAvailable) { validationResult.Add($"Condition Type {bonusType} is not available Type"); } if (validateIfStakeable && !type.IsStakeable) { validationResult.Add($"Condition Type {bonusType} is not stakeable Type"); } return(validationResult); }
public async Task <BonusTypeModel> GetByTypeAsync(string type) { var bonusType = await _bonusTypeService.GetAsync(type); return(_mapper.Map <BonusTypeModel>(bonusType)); }