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