public static async Task AddComment(int id, CommentModel comment, string sessionKey) { headers[sessionHeaderName] = sessionKey; await HttpRequester.Post(baseUrl + "comment/" + id.ToString(), comment, headers); }
private async void HandleAddComment(object obj) { if(!string.IsNullOrEmpty(CommentText)) { var comment = new CommentModel() { Content = this.CommentText }; await HelpRequestsPersister.AddComment(Request.Id, comment, AccountManager.CurrentUser.SessionKey); var fullRequest = await HelpRequestsPersister.GetRequestById(Request.Id, AccountManager.CurrentUser.SessionKey); this.Request = fullRequest; this.CommentText = ""; OnPropertyChanged("Request"); OnPropertyChanged("CommentText"); } }