public void DeleteTest() { List <UserAddress> addresss = UserAddressManager.Load(); UserAddress address = addresss.Where(c => c.City == "OshkoshTest2").FirstOrDefault(); int actual = UserAddressManager.Delete(address.Id); Assert.IsTrue(actual > 0); }
private void btnDelete_Click(object sender, RoutedEventArgs e) { int result = UserAddressManager.Delete(address.Id); if (result >= 1) { MessageBox.Show("Address deleted."); this.Close(); } else { MessageBox.Show("An error occurred when deleting."); } }
// DELETE: api/UserAddress/5 public void Delete(Guid id) { UserAddressManager.Delete(id); }
public void DeleteUserAddress(UserAddress UserAddress) { userAddressManager.Delete(UserAddress); userAddressManager.Save(); }