public void Append(IChain child) { if (child == null) { throw new ArgumentNullException("child"); } child.AppendTo(this); var chain = Children.FirstOrDefault(c => c.Id.Equals(child.Id)); if (chain != null) { Children.Remove(chain); } Children.Add(child); }