private bool _Evaluate(KStore store, KUser user) { if (Identities.Contains(user.GetIdentity())) { return(true); } if (EnableRollout && !Rollout.Evaluate(Key + user.GetIdentity())) { return(false); } if (EnableRollout && Rules.ToList().Count == 0) { return(true); } return(Rules.Any(rule => rule.Evaluate(store, user))); }
public bool Evaluate(KStore store, KUser user) { switch (Targeting) { case KTargeting.DisabledForAll: return(false); case KTargeting.EnabledForAll: return(true); case KTargeting.EnabledForSomeUsers: return(_Evaluate(store, user)); default: return(false); } }
public abstract bool Evaluate(KStore store, KUser user);
public bool Evaluate(KStore store, KUser user) { return(Rules.Any(rule => rule.Evaluate(store, user))); }
public string ValueOf(string remoteConfig, KUser user, string defaultValue) { var rc = _store.GetRemoteConfig(remoteConfig); return(rc?.Evaluate(_store, user) ?? defaultValue); }
public bool Evaluate(string feature, KUser user) => _store.GetFeatureFlag(feature)?.Evaluate(_store, user) ?? false;
public KEvaluationResult Evaluate(KUser user) { var evaluatedFlags = _store.GetFeatureFlags().ToDictionary(x => x.Key, flag => flag.Evaluate(_store, user)); return(new KEvaluationResult(evaluatedFlags)); }
public string Evaluate(KStore store, KUser user) { return(Rules.Aggregate(DefaultValue, (s, rule) => rule.Evaluate(store, user) ? rule.Value : s)); }