Esempio n. 1
0
        public IActionResult GetById([FromRoute] int id)
        {
            var response = _marcaService.GetById(id);

            if (response.ObjectResponse == null)
            {
                return(NotFound());
            }

            return(Ok(response.ObjectResponse));
        }
Esempio n. 2
0
        public ActionResult Create(string editAction, string marcaId)
        {
            MarcaDTO marcaDTO = new MarcaDTO();

            switch (editAction)
            {
            case EditActionConstant.NEW:
                break;

            case EditActionConstant.EDIT:
                marcaDTO = marcaService.GetById(Convert.ToInt32(marcaId));
                break;
            }
            return(PartialView(marcaDTO));
        }
Esempio n. 3
0
 public MarcaViewModel ObterPorId(Guid id)
 {
     return(_mapper.Map <MarcaViewModel>(_marcaService.GetById(id)));
 }
Esempio n. 4
0
        public ActionResult Edit(int id)
        {
            var model = marcaService.GetById(id);

            return(View("Create", model));
        }
Esempio n. 5
0
 public MarcaResponseViewModel GetById(Guid id)
 {
     return _mapper.Map<MarcaResponseViewModel>(_marcaService.GetById(id));
 }