public async Task <List <CustomerViewModel> > GetAllCustomerAsync( CancellationToken ct = default(CancellationToken)) { var customers = CustomerConverter.ConvertList(await _customerRepository.GetAllAsync(ct)).ToList(); return(customers); }
public async Task <List <CustomerViewModel> > GetCustomerBySupportRepIdAsync(int id, CancellationToken ct = default(CancellationToken)) { var customers = await _customerRepository.GetBySupportRepIdAsync(id, ct); return(CustomerConverter.ConvertList(customers).ToList()); }
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)); } }