// GET: ModelController public async Task <ActionResult> Index() { var models = await _repo.FindAll(); var model = _mapper.Map <List <Model>, List <ModelVM> >(models); return(View(model)); }
public async Task <IActionResult> GetModels() { try { var models = await _modelRepository.FindAll(); var response = _mapper.Map <IList <ModelDTO> >(models); return(Ok(response)); } catch (Exception e) { return(InternalError($"{e.Message} - {e.InnerException}")); } }
public List <T> FindAll() { return(_modelRepository.FindAll()); }
//Read public IEnumerable <Model> GetAll() { var result = modelRepository.FindAll(); return(result); }