Esempio n. 1
0
        static void Delete(IContactRepo repo)
        {
            var contact = new Contact
            {
                FirstName = "Viktor",
                LastName  = "Prykhidko",
                Email     = "*****@*****.**",
                Company   = "xyz",
                Title     = "Dev"
            };

            repo.Add(contact);
            var c = repo.Find(contact.Id);

            repo.Remove(c.Id);
            c = repo.Find(contact.Id);
            Debug.Assert(c == null);
            Console.WriteLine("Deleted");
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> Delete([FromBody] int id)
        {
            var result = await _contactRepo.Remove(id);

            return(Ok(result));
        }