public IActionResult Search(string message, int?id) { try { if (id != null) { ViewBag.Obuka = id; } else { ViewBag.Obuka = null; } ViewBag.ListaPasa = service.GetAll().ToList(); ViewBag.ListaObuka = serviceObuka.GetAll().ToList(); if (message == null) { message = string.Empty; } ViewBag.Message = message; return(View()); } catch (Exception ex) { return(RedirectToAction("Error", "Home", new { message = ex.Message })); } }
public ActionResult <IEnumerable <Obuka> > Get() { var obuke = _service.GetAll().ToList(); var obukeDTO = _mapper.Map <IEnumerable <ObukaDTO> >(obuke); return(Ok(obukeDTO)); }
private void ObukeDropDownList(object izabranaObuka = null) { var obukeQuery = from o in service.GetAll().AsQueryable() orderby o.Naziv select o; ViewBag.ObukaId = new SelectList(obukeQuery.AsNoTracking(), "Id", "Naziv", izabranaObuka); }
public IActionResult Index() { ViewBag.Obuke = service.GetAll().ToList(); return(View(service.GetAll().ToList())); }