public ActionResult GetCountries(RequestContries req) { try { return(Ok(mySrv.GetCountries(req))); } catch (Exception exc) { logger.LogError(exc, "Error at GetCountries"); return(StatusCode(StatusCodes.Status500InternalServerError, "Intern feil ved GetCountries")); } }
internal List <ResponseCountries> GetCountries(RequestContries req) { List <ResponseCountries> countryList = new List <ResponseCountries>(); for (int i = 0; i < req.Countries; i++) { System.Threading.Thread.Sleep(req.Pause); countryList.Add( new ResponseCountries() { CountryId = Faker.RandomNumber.Next(100, 999), Country = Faker.Country.Name(), CountryCode = Faker.Country.TwoLetterCode() }); } return(countryList); }