private void MergeBehaviours(IEnumerable <Behaviour> behaviours) { var inc = 0; foreach (var b in behaviours) { var existing = Behaviours.FirstOrDefault(x => x.Name == b.Name); if (existing != null) { existing.Values.AddRange(b.Values.Where(x => !existing.Values.Contains(x))); } else { Behaviours.Insert(inc++, b); } } }