public void RemoveNinja() { var ninja = _ninjaRepository.GetAll().First(o => o.Name == SelectedNinja.Name); if (_ninjaRepository.Delete(ninja)) { NinjaCollection.Remove(NinjaCollection.First(o => o.Id == SelectedNinja.Id)); } UpdateCollection(); }
public IActionResult Index() { var ninjas = _repo.GetAll(); return(View(ninjas.Select(n => new NinjaIndexViewModel(n)))); }