public CampaignResult Apply(CampaignInput input) { var result = new CampaignResult() { IsSuccess = true }; try { Validation(input); result.Discount = GetDiscount(); } catch (Exception ex) { result.IsSuccess = false; result.ExMessage = ex.Message; } return(result); }
protected abstract void Validation(CampaignInput input);
protected override void Validation(CampaignInput input) { Condition.Requires(input.OrderTotal).IsGreaterThan(50); }