public async Task <IActionResult> Get()
        {
            var clients = await clienteServices.GetAll();

            var response = new ApiResponse <IEnumerable <ClientResponseDto> >(clients);

            return(Ok(response));
        }
Exemple #2
0
        public IActionResult Get()
        {
            var clients = _clientServices.GetAll();

            if (clients.Count == 0)
            {
                return(NoContent());
            }
            return(Ok(clients));
        }
Exemple #3
0
 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));
        }
Exemple #5
0
 // GET: api/WebApiClient
 public IQueryable <Client> GetProject()
 {
     return(CS.GetAll().AsQueryable());
 }
Exemple #6
0
        public IEnumerable <ClientViewModel> GetAll()
        {
            var resultService = _clientServices.GetAll();

            return(_mapper.Map <List <ClientViewModel> >(resultService));
        }