Exemplo n.º 1
0
        public async Task <ActionResult> JobDetails(string id)
        {
            if (!id.IsNullOrWhiteSpace())
            {
                String url     = $"https://jobs.github.com/positions/{id}.json";
                String results = await RequestsModel.GetRequest(url);

                ResultModel resultModel = JsonConvert.DeserializeObject <ResultModel>(results);

                return(View(resultModel));
            }

            return(RedirectToAction("Search"));
        }
Exemplo n.º 2
0
        public async Task <ActionResult> SearchResults(string description, string location)
        {
            if (description.IsNullOrWhiteSpace())
            {
                return(RedirectToAction("Search"));
            }

            String url     = $"https://jobs.github.com/positions.json?description={description}&page=0";
            String results = await RequestsModel.GetRequest(url);

            List <ResultModel> resultsModel = JsonConvert.DeserializeObject <List <ResultModel> >(results);

            return(View(resultsModel));
        }