Exemple #1
0
        public async Task <List <CustomerViewModel> > GetAllCustomerAsync(
            CancellationToken ct = default(CancellationToken))
        {
            var customers = CustomerConverter.ConvertList(await _customerRepository.GetAllAsync(ct)).ToList();

            return(customers);
        }
Exemple #2
0
        public async Task <List <CustomerViewModel> > GetCustomerBySupportRepIdAsync(int id,
                                                                                     CancellationToken ct = default(CancellationToken))
        {
            var customers = await _customerRepository.GetBySupportRepIdAsync(id, ct);

            return(CustomerConverter.ConvertList(customers).ToList());
        }
Exemple #3
0
 public async Task <IActionResult> Get()
 {
     try
     {
         return(Ok(
                    CustomerConverter.ConvertList(
                        await _context.Customer.ToListAsync()
                        )
                    ));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, ex.Message);
         return(StatusCode(500, ex.Message));
     }
 }