Ejemplo n.º 1
0
 public static List <GroupData> GetAll()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Groups select g).ToList());
     }
 }
Ejemplo n.º 2
0
 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());
     }
 }
Ejemplo n.º 3
0
 public static List <GroupData> GetAll()
 {
     using (AddressbookDB db = new AddressbookDB())
     {
         return((from g in db.Groups select g).ToList());
         // db.Close(); не надо прописывать, т.к. автоматом закрывается
     }
 }
Ejemplo n.º 4
0
 public List <ContactData> 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());
     }
 }