diff --git a/.vs/DeskHubSharp/v15/.suo b/.vs/DeskHubSharp/v15/.suo index 767ffd8..8fbe526 100644 Binary files a/.vs/DeskHubSharp/v15/.suo and b/.vs/DeskHubSharp/v15/.suo differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide index 1017f59..c1cb1ca 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm index 780168d..ba7265d 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-shm differ diff --git a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal index 6354ba0..8c45de2 100644 Binary files a/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal and b/.vs/DeskHubSharp/v15/Server/sqlite3/storage.ide-wal differ diff --git a/DeskHubSharp/BusinessLayer/Request.cs b/DeskHubSharp/BusinessLayer/Request.cs index 74eebe8..73b1e56 100644 --- a/DeskHubSharp/BusinessLayer/Request.cs +++ b/DeskHubSharp/BusinessLayer/Request.cs @@ -1,25 +1,54 @@ -using System; +using RestSharp; +using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Mail; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; namespace DeskHubSharp { class Request { + // TODO: this is rudimentary, fix it + // i.e. try catch statements + private string _apiEndpoint = "https://api.github.com/"; + private string _query; - public Request() + public Request(string query) { - + _query = query; } public void SearchRequest() { + var client = new RestClient(_apiEndpoint); + RestRequest requestRepo = new RestRequest($"users//{_query}//repos", Method.GET); + + var response = client.Execute(requestRepo).ToString(); + + Deserialize(response); + + } + + public void UserRequest() + { + var client = new RestClient(_apiEndpoint); + + RestRequest requestUser = new RestRequest($"users//{_query}", Method.GET); + + string response = client.Execute(requestUser).ToString(); + + Deserialize(response); + } + + private void Deserialize(string response) + { + var deserialized = JsonConvert.DeserializeObject(response); } } diff --git a/DeskHubSharp/Models/RepoList.cs b/DeskHubSharp/Models/RepoList.cs index 42fc2e8..a7a7e59 100644 --- a/DeskHubSharp/Models/RepoList.cs +++ b/DeskHubSharp/Models/RepoList.cs @@ -1,16 +1,14 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DeskHubSharp { - class RepoList + class RepoList : ObservableCollection { - // ideas - // 1. have a for loop iterate on copies on this one particular file, if possible :p - // 2. have the request/reponse go through the DAL/jsondataservice.cs and have it dish out the response that way - // to be continued... + } }