public bool Delete(int id) { bool status = false; PartyRepository repo = new PartyRepository(); status = repo.Delete(id); return(status); }
public ActionResult Delete(int id, string confirmButton) { Party party = partyRepository.GetParty(id); if (party == null) { return(View("NotFound")); } partyRepository.Delete(party); partyRepository.Save(); return(View("Deleted")); }
public async Task TestPartyDelete() { try { UOW.BeginTransaction(); Party result = await partyRepository.GetByID(Context, 1); Assert.IsNotNull(result, "Expect to find Democratic Party"); Assert.AreEqual(result.Description, "Democratic Party", "Expect to find Party Description = Democratic Party"); Party deleted = await partyRepository.Delete(UOW, result.Id); UOW.CloseTransaction(); Assert.IsTrue(deleted.Active == false, "Expect new Party active flag to be false."); } catch (Exception ex) { Assert.IsNull(ex, "Exception Thrown: " + ex.Message); } }
public void DeleteParty(int partyId) { PartyRepository.Delete(partyId); }