public TreaterModel() { ICandyRepository candyRepo = new CandyDBRepository(); CandyList = new List <Candy>(candyRepo.GetList()); ICostumeRepository costumeRepo = new CostumeDBRepository(); CostumeList = new List <Costume>(costumeRepo.GetList()); ITreaterRepository treaterRepo = new TreaterDBRepository(); TreaterList = new List <Treater>(treaterRepo.GetList()); }
public IActionResult Delete(CostumeModel model) { int id = -1; var repo = new CostumeDBRepository(); foreach (var costume in repo.GetList()) { if (costume.Name == model.Name) { id = costume.Id; break; } } if (id != -1) { repo.Delete(id); } return(RedirectToAction("Index")); }
public CostumeModel() { ICostumeRepository costumeRepo = new CostumeDBRepository(); CostumeList = new List <Costume>(costumeRepo.GetList()); }