public Rule Update(RuleAction newAction) { Guard.NotNull(newAction); if (newAction.GetType() != action.GetType()) { throw new ArgumentException("New action has another type.", nameof(newAction)); } newAction.Freeze(); return(Clone(clone => { clone.action = newAction; })); }
private void SetAction(RuleAction newAction) { action = newAction; action.Freeze(); }