public void Edit(int id) { var item = new LendablesRepository().Load(id); var type = item.GetType().Name; PropertyBag[type] = item; RenderView("Edit" + type); }
public void Index(string[] q) { var query = string.Join("", q); PropertyBag["Lendables"] = new LendablesRepository().FindAllTitledLike(query); if (Request.Headers["X-Requested-With"] != null) { CancelLayout(); PropertyBag["HideButtons"] = true; } }
public SubscribersRepository() { LendablesRepository lendablesRepository = new LendablesRepository(); subscribers[1].Lendables.Add(lendablesRepository.Load(1)); subscribers[1].Lendables.Add(lendablesRepository.Load(2)); subscribers[2].Lendables.Add(lendablesRepository.Load(10)); subscribers[2].Lendables.Add(lendablesRepository.Load(11)); subscribers[3].Lendables.Add(lendablesRepository.Load(3)); subscribers[3].Lendables.Add(lendablesRepository.Load(11)); }
/* readonly ILendablesRepository lendablesRepository; public LendablesController(ILendablesRepository lendablesRepository) { this.lendablesRepository = lendablesRepository; } */ public void Index() { PropertyBag["Lendables"] = new LendablesRepository().FindAll(); }