public async Task <IActionResult> Get(int lId, string status)
        {
            CurrentUser cUser = new CurrentUser(HttpContext, _configuration);

            try
            {
                var result = await cntryRepo.GetAllCountries(lId, status);

                await auditLogService.LogActivity(cUser.UserId, cUser.HostIP, cUser.SessionId, "Country", "Country list Loaded.");

                return(Ok(result));
            }
            catch (CustomException cex)
            {
                var responseObj = new EmaintenanceMessage(cex.Message, cex.Type, cex.IsException, cex.Exception?.ToString());
                return(StatusCode(StatusCodes.Status500InternalServerError, responseObj));
            }
            catch (Exception ex)
            {
                return(Ok(new EmaintenanceMessage(ex.Message)));
            }
        }
Example #2
0
 public static List <Country> GetCountries()
 {
     return(CountryRepo.GetAllCountries());
 }