public IActionResult GetAll() { try { var response = _mapper.Map <IList <Local>, IList <LocalViewModel> >(_localAppService.GetAll()); return(Ok(response)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
// GET api/locais public IEnumerable <LocalViewModel> Get() { var localviewmodel = Mapper.Map <IEnumerable <Local>, IEnumerable <LocalViewModel> >(_localApp.GetAll()); return(localviewmodel); }