public void SetCustomField(string name, string value) { var field = CustomFields.FirstOrDefault(f => f.Name == name); if (field == null) { field = new CustomerCustomField(name, value); CustomFields.Add(field); } else { field.Value = value; } }