Esempio n. 1
0
 public async Task <List <CustomerSearchRepoResponseModel> > SearchCustomers(string name)
 {
     try
     {
         return(await GetCustomers(name));
     }
     catch (Exception ex)
     {
         _dataLogger.LogError(ex);
         throw;
     }
 }
        public async Task <ActionResult <IEnumerable <CustomerSearchMvcResponseModel> > > Index()
        {
            _dataLogger.LogInformation("In WebUi.Controllers.CustomerSearchControllerIndex()");

            try
            {
                return(View(await GetCustomers(string.Empty)));
            }
            catch (Exception ex)
            {
                _dataLogger.LogError(ex);
                return(BadRequest(base.GetResponseObject(Constants.ERROR_RESPONSE, Constants.ERROR_RESPONSE)));
            }
        }
Esempio n. 3
0
 public async Task <OrderRepoResponse> GetOrder(int orderId)
 {
     validateOrderId(orderId);
     _dataLogger.LogInformation("Input data", orderId);
     try
     {
         return(await GetOrderData(orderId));
     }
     catch (Exception ex)
     {
         _dataLogger.LogError(ex);
         throw;
     }
 }
Esempio n. 4
0
 public async Task <List <ClientOrderRepoResponseModel> > GetClientOrders(int clientId)
 {
     validateGetClientOrders(clientId);
     _dataLogger.LogInformation("Input data", clientId);
     try
     {
         return(await GetClientOrdersSqlResults(clientId));
     }
     catch (Exception ex)
     {
         _dataLogger.LogError(ex);
         throw;
     }
 }
Esempio n. 5
0
 private void LogTheException(Exception ex, IDataLogger dataLogger)
 {
     dataLogger.LogError(ex);
 }