public async Task <int> MakeComment(NewCommentWebModel model)
        {
            int myAthleteID = new UserProfileLogic(db).GetAthleteIDForUserName(User.Identity.Name);
            int id          = await new FeedLogic(db).MakeComment(myAthleteID, model.ObjectType, model.ObjectID, model.Text, true);

            return(id);
        }
Example #2
0
        public async Task <int?> MakeComment(NewsfeedItemTypeEnum objectType, int objectID, string text)
        {
            string url = WebApiUrl + "Newsfeed/MakeComment";

            try
            {
                NewCommentWebModel model = new NewCommentWebModel()
                {
                    ObjectType = objectType,
                    ObjectID   = objectID,
                    Text       = text
                };
                string json = await this.sendPostRequestAndReceiveResponse(url, model, true);

                int modelResponse = JsonConvert.DeserializeObject <int>(json);
                return(modelResponse);
            }
            catch (Exception exc)
            {
                LastExceptionUrl = url;
                LastException    = exc;
                return(null);
            }
        }