public void Update(string property, TargetOption option, string valueList) { Guard.IsNotNullOrEmpty(property, "Invalid property"); Guard.IsNotNullOrEmpty(valueList, "Invalid userList"); Option = option; Property = property; ValuesList = ValuesList.NewList(valueList); }
public override bool IsTarget(TargetUser user) { if (!user.ContainsKey(Property)) { return(false); } var value = user[Property]; return(ValuesList.Apply(value, Option)); }
public static TargetSpecificUsers New(UserTargeting userTargeting, string property, TargetOption option, string valueList) { Guard.IsNotNullOrEmpty(property, "Invalid property"); Guard.IsNotNullOrEmpty(valueList, "Invalid userList"); return(new TargetSpecificUsers { Option = option, Property = property.ToLower(), UserTargetingId = userTargeting.Id, UserTargeting = userTargeting, ValuesList = ValuesList.NewList(valueList) }); }