Пример #1
0
 public Contact GetContact(int id)
 {
     using (var context = ContactFactory.CreateContext())
     {
         var contactItem = (from contact in context.Contacts where contact.ID == id select contact).SingleOrDefault();
         return(contactItem);
     }
 }
Пример #2
0
        public List <Contact> GetContacts()
        {
            using (var context = ContactFactory.CreateContext())
            {
                var contactList = (from contacts in context.Contacts select contacts).ToList();

                return(contactList);
            }
        }