public static List <ContactData> GetAll() { using (AddressBookDB db = new AddressBookDB()) { return((from c in db.Contacts.Where(x => x.Deprecated == "0000-00-00 00:00:00") select c).ToList()); } }
public static List <GroupData> GetAll() { using (AddressBookDB db = new AddressBookDB()) { return((from g in db.Groups select g).ToList()); } }
public List <PropertiesContact> GetContacts() { using (AddressBookDB db = new AddressBookDB()) { return((from c in db.Contacts from gcr in db.GCR.Where(p => p.GroupId == Id && p.ContactId == c.Id && c.Deprecated == "0000-00-00 00:00:00") select c).Distinct().ToList()); } }
public List <ContactData> GetContactsNotInGroups() { using (AddressBookDB db = new AddressBookDB()) { return((from c in db.Contacts.Where(c => c.Deprecated == "0000-00-00 00:00:00") where !db.GCR.Any(g => (g.ContactId == c.Id)) select c).Distinct().ToList()); } }