public User(string email, string password, string name, int age) { this.email = email; this.password = password; this.name = name; this.age = age; this.newsFeed = new Stack <Recipe>(); this.notifications = new Stack <string>(); this.MyMenu = new MyMenu(); this.followers = new SimpleList <String>(); this.rating = 0; this.isChef = false; }
private async System.Threading.Tasks.Task updateFeedAsync() { try { HttpClient client = new HttpClient(); // ? ---> para decir que van parametros SOLO EL PRIMERO // & ---> para separar un parametro de otro. :) client.BaseAddress = new Uri(Client.HTTP_BASE_URL + "user/feed?email=" + this.email); HttpResponseMessage response = await client.GetAsync(client.BaseAddress); //Get the json from the sever NULL if didn't match String json = response.Content.ReadAsStringAsync().Result; //Serialize the json object to a User object and assign it to the Client User Stack <Recipe> newFeed = JsonConvert.DeserializeObject <Stack <Recipe> >(json); this.newsFeed = newFeed; } catch (Exception e) { //exception } }