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"); }
public async Task <IHttpActionResult> Delete([FromBody] int id) { var result = await _contactRepo.Remove(id); return(Ok(result)); }