public IActionResult Editar(int Id) { TempData["Message"] = null; var Categoria = _categoriaService.Get(Id); return(View(Categoria)); }
public IActionResult Get() { try { var categoriaResponse = _categoriaService.Get(); return(Ok(categoriaResponse)); } catch (Exception ex) { return(StatusCode((int)HttpStatusCode.InternalServerError, new { StatusCode = (int)HttpStatusCode.InternalServerError, ErrorMessage = ex.Message, stackTrace = ex.StackTrace })); } }
public async Task <ActionResult> Get() { try { return(Ok(await _categoriaService.Get())); } catch (Exception ex) { return(Error(ex)); } }
// GET: User/NovoOuEditar public async Task <ActionResult> NovoOuEditar(int id = 0) { if (id == 0) { return(View(new CategoriaDTOCreate())); } else { var user = await _serService.Get(id); var u = _mapper.Map <CategoriaDTOCreate>(user); return(View(u)); } }
public async Task <ActionResult> Get(int id) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); //400 bad request - solicitaçao invalidos } try { return(Ok(await _service.Get(id))); } catch (ArgumentException e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message)); } }
public IActionResult Get(int id) { return(Ok(_ICategoriaService.Get(id))); }
public IActionResult Get() { return(Ok(categoriaService.Get())); }
public IActionResult Get(int id) { return(Json( _categoriaService.Get(id) )); }
public Categoria Get(int id) { return(_categoriaService.Get(id)); }
// GET: api/Categorias public ICollection <CategoriaVO> Get() { return(sut.Get()); }