public async Task <IActionResult> Get() { var clients = await clienteServices.GetAll(); var response = new ApiResponse <IEnumerable <ClientResponseDto> >(clients); return(Ok(response)); }
public IActionResult Get() { var clients = _clientServices.GetAll(); if (clients.Count == 0) { return(NoContent()); } return(Ok(clients)); }
public ActionResult <IEnumerable <Client> > GetAll() { try { _logger.LogInformation("Received get request"); return(Ok(_clientService.GetAll())); } catch (Exception exception) { _logger.LogError(exception, exception.Message); return(new StatusCodeResult(500)); } }
public IActionResult All() { List <Client> Clients = clientServices.GetAll().ToList(); List <EditClientViewModel> model = Clients.Select(q => new EditClientViewModel { Id = q.Id, FirstName = q.FirstName, LastName = q.LastName, PhoneNumber = q.PhoneNumber, Email = q.Email, IsAdult = q.IsAdult }).ToList(); return(View(model)); }
// GET: api/WebApiClient public IQueryable <Client> GetProject() { return(CS.GetAll().AsQueryable()); }
public IEnumerable <ClientViewModel> GetAll() { var resultService = _clientServices.GetAll(); return(_mapper.Map <List <ClientViewModel> >(resultService)); }