// GET: Livros/Create public IActionResult Create() { ViewBag.Autores = _autorService.GetAll(); ViewBag.Generos = _generoService.GetAll(); return(View()); }
// GET: Filme/Create public ActionResult Create() { TempData["Generos"] = new SelectList( generoService.GetAll(), "Id", "Nome" ); TempData.Keep(); return(View()); }
// GET: Generos public async Task <IActionResult> Index(string search) { var generos = _service.GetAll(); if (!string.IsNullOrEmpty(search)) { generos = generos.Where(x => x.Nome.Contains(search)).ToList(); } return(View(await Task.FromResult(generos))); }
public async Task <IActionResult> GetAll() { try { var retorno = await _rep.GetAll(); if (retorno.Sucesso == false) { return(BadRequest(retorno)); } return(Ok(retorno)); } catch (Exception ex) { GerarLog("Erro ao obter genero", ex: ex); return(StatusCode(500, ex.ToString())); } }
public async Task <IActionResult> GetAllGeneros() { var result = await _generoService.GetAll(); return(Ok(result)); }
// GET: Genero public ActionResult Index() { var generoViewModel = Mapper.Map <List <GeneroViewModel> >(generoService.GetAll()); return(View(generoViewModel)); }
public ActionResult <IEnumerable <dynamic> > Get() { var result = _generoService.GetAll(); return(Ok(result)); }
public IEnumerable <Genero> GetAll() { return(_generoService.GetAll()); }