Ejemplo n.º 1
0
     public IActionResult GetSalary([FromQuery] SalaryRequest request)
     {
         try
         {
             ISalaryResponse response = _salaryClient.GetSalary(request);
             LogData         logData  = new()
             {
                 CallSide         = nameof(SalaryController),
                 CallerMethodName = nameof(GetSalary),
                 CreatedOn        = _dateTimeUtil.GetCurrentDateTime(),
                 Request          = request,
                 Response         = response
             };
             _logger.AddLog(logData);
             return(Ok(response));
         }
         catch (Exception ex)
         {
             LogData logData = new()
             {
                 CallSide         = nameof(SalaryController),
                 CallerMethodName = nameof(GetSalary),
                 CreatedOn        = _dateTimeUtil.GetCurrentDateTime(),
                 Request          = request,
                 Response         = ex
             };
             _logger.AddErrorLog(logData);
             return(InternalServerError());
         }
     }
 }
Ejemplo n.º 2
0
        private void GetSalaryById()
        {
            Console.WriteLine("Enter Salary ID :");
            int id  = Convert.ToInt32(Console.ReadLine());
            var res = client1.GetSalary(id);

            Console.WriteLine(" " + res.SalaryId + " " + res.Amount + " " + res.Tax + " ");
        }