public void RemoveExtraValue(CMSDataContext db, string field) { var ev = ContactExtras.AsEnumerable().FirstOrDefault(ee => string.Compare(ee.Field, field, ignoreCase: true) == 0); if (ev != null) { db.ContactExtras.DeleteOnSubmit(ev); ev.TransactionTime = DateTime.Now; } }
public ContactExtra GetExtraValue(string field) { var ev = ContactExtras.AsEnumerable().FirstOrDefault(ee => ee.Field.Equal(field)); if (ev == null) { ev = new ContactExtra() { ContactId = ContactId, Field = field, }; ContactExtras.Add(ev); } return(ev); }