Beispiel #1
0
 protected override async Task ExecuteAsync(CancellationToken cancellationToken)
 {
     while (!cancellationToken.IsCancellationRequested)
     {
         _crmServices.GetCustomerFromCRM();
         await Task.Delay(TimeSpan.FromHours(2), cancellationToken);
     }
 }
Beispiel #2
0
 public ActionResult <dynamic> AddNewCustomerFromCRM()
 {
     try
     {
         var insertCount = _crmService.GetCustomerFromCRM();
         return(Ok(new ResponseContext
         {
             code = (int)Common.ResponseCode.SUCCESS,
             message = Common.Message.SUCCESS,
             data = insertCount
         }));
     }
     catch (Exception ex)
     {
         _logger.LogError(ex, ex.Message);
         return(StatusCode(StatusCodes.Status500InternalServerError, new ResponseMessage {
             status = "ERROR", message = ex.Message
         }));
     }
 }