private static void AdicionaContato() { Contact contact = new Contact(); contact.Name = "bada"; contact.Phone = "(22) 9999-9999"; contact.Email = "*****@*****.**"; contact.Birth = DateTime.Now; ContactDAO dao = new ContactDAO(); dao.Adiciona(contact); }
static void Main(string[] args) { //AdicionaContato(); ContactDAO dao = new ContactDAO(); Contact contactToChange = dao.BuscaPorId(3); contactToChange.Name = "Bartolomeu"; dao.Atualiza(contactToChange); Console.WriteLine("Finalizado"); dao.Remove(contactToChange); IList<Contact> contacts = dao.Lista(); foreach(var contact in contacts) { Console.WriteLine(contact.Name); } Console.ReadLine(); }