public ActionResult DeleteSpecialtyFinal(int id) { Specialty selectedSpecialty = Specialty.Find(id); selectedSpecialty.Delete(); selectedSpecialty.DeleteFromJoin(); return(View()); }
public ActionResult DeleteSpecialty(int id) { Specialty selectedSpecialty = Specialty.Find(id); List <Stylist> foundStylist = Specialty.GetStylistBySpecialty(id); selectedSpecialty.DeleteFromJoin(); return(View(foundStylist)); }
public void Delete_DeleteFromStylists_specialty() { Stylist testStylist1 = new Stylist("testName"); testStylist1.Save(); Specialty testSpecialty1 = new Specialty("test1"); testSpecialty1.Save(); Specialty.AddNewSpecialtyJoinStylist(testStylist1.GetId(), testSpecialty1.GetSpecialtyId()); testSpecialty1.DeleteFromJoin(); List <Stylist> testSpecialty = Specialty.GetStylistBySpecialty(testSpecialty1.GetSpecialtyId()); Assert.AreEqual(0, testSpecialty.Count); }