public List<RespGetVideoComments> GetVideoComments(ReqGetVideoComments objReq) { var objlist = new List<RespGetVideoComments>(); using (var db = new UnseentalentdbDataContext()) { IEnumerable<RespGetVideoComments> items = db.usp_GetVideoComments(Convert.ToInt64(objReq.videoId)).Select(n => new RespGetVideoComments { commentId = Convert.ToString(n.commentId), userId = Convert.ToString(n.userId), userName = n.username, profilePic = ReturnProfilePicture(n.profilePic), commentText = n.commentText, timeAgo = "", }); objlist.AddRange(items); } return objlist; }
public Response<List<RespGetVideoComments>> GetVideoComments(ReqGetVideoComments objReq) { var objresponse = new Response<List<RespGetVideoComments>>(); var objlist = new List<RespGetVideoComments>(); var objmethod = new UnseenTalentsMethod(); try { objlist = objmethod.GetVideoComments(objReq); objresponse.Create(true, 0, "Events for admin", objlist); } catch (Exception ex) { objresponse.Create(false, -1, "Events for admin", objlist); } return objresponse; }