Exemplo n.º 1
0
        // GET api/values/5
        public List <ContactDetails> GetAllContacts()
        {
            ContactDatabase contactDatabase = new ContactDatabase();
            var             contactList     = contactDatabase.GetAllContacts();
            var             allcontacts     = (from c in contactList
                                               select new ContactDetails
            {
                Id = c.Id,
                FirstName = c.FirstName,
                LastName = c.LastName,
                Email = c.Email,
                PhoneNumber = c.PhoneNumber,
                IsActive = c.Status
            }).ToList();

            ///To Save a Contact
            ///Post("xyz","lmn","*****@*****.**",12345);

            ///Delete a Contact
            ///Delete(3); --Id to deleted

            return(allcontacts);
        }