public ActionResult AddSubComment(string CommentMsg, string postorcmtId, string destinationId) { SubCommentModel data1 = new SubCommentModel(); data1.CommentId = Guid.Parse(postorcmtId); data1.SubCommentmsg = CommentMsg; data1.SourceUserId = User.Identity.GetUserId(); data1.SubCommentId = Guid.NewGuid(); data1.DestinationUserId = destinationId; try { var Result = data.SaveSubcomment(SessionToken, data1).Entity; if (Result != null) { return(Json(new { _result = Result.result, CDate = Result.CommentDate, CId = Result.CommentId, cmt = Result.CommentMsg, Name = Result.UserName })); } else { return(Json(new { _result = false })); } } catch (Exception ex) { return(Json(new { result = false })); // return View("~/Views/Errorpage/Errorpage.cshtml"); } }
public RequestResult <CommentResponceModel> SaveSubComment(string sessionToken, SubCommentModel model) { string parameters = $"/savecommonfunctionality/savesubcomment?sessionToken={sessionToken}"; try { var serilizedData = JsonConvert.SerializeObject(model); return(PostAndGetData <RequestResult <CommentResponceModel> >(sessionToken, parameters, serilizedData)); } catch (Exception ex) { throw ex; } }
public RequestResult <CommentResponceModel> SaveSubcomment(string sessionToken, SubCommentModel model) { try { return(_repository.SaveSubComment(sessionToken, model)); } catch (Exception ex) { throw ex; } }