public void AddAudienceRestriction(string audience) { if (Conditions == null) { Conditions = new ConditionGroup(); } var restriction = Conditions.Conditions.OfType <AudienceRestriction>().FirstOrDefault(); if (restriction == null) { restriction = new AudienceRestriction(); Conditions.Add(restriction); } restriction.Add(audience); }
public void AddAudienceRestriction(string audience) { if (Conditions == null) { Conditions = new ConditionGroup(); } var restriction = Conditions.Conditions.OfType<AudienceRestriction>().FirstOrDefault(); if (restriction == null) { restriction = new AudienceRestriction(); Conditions.Add(restriction); } restriction.Add(audience); }