Beispiel #1
0
        static void Main(string[] args)
        {
            var contact = new tbl_contact()
            {
                FirstName   = "Joe",
                LastName    = "Smith",
                Address     = "123",
                PhoneNumber = "555",
                Birthday    = new DateTime(1980, 1, 1)
            };

            var op = new ContactOperations();

            //op.Create(contact);
            //op.Update(2, contact);
            op.Delete(2);
            var list = op.Read();

            foreach (var elem in list)
            {
                Console.WriteLine($"{elem.FirstName} {elem.LastName} {elem.Address} {elem.PhoneNumber} {elem.Birthday}");
            }

            // Pause at the end
            Console.Read();
        }
Beispiel #2
0
        /// <summary>
        /// Delete a contact by ID
        /// </summary>
        /// <param name="id"></param>
        public void Delete(int id)
        {
            if (id < 1)
            {
                return;
            }

            var op = new ContactOperations();

            op.Delete(id);
        }