// GET: FeedBack public async Task <ActionResult> MessagesList(int?taskID) { List <FeedbackModel> lstVm = new List <FeedbackModel>(); if (taskID > 0) { lstVm = await feedVM.Get(taskID); } else { var id = Convert.ToInt32(this.Session["taskID"]); lstVm = await feedVM.Get(id); } FeedbackModel msgModel = new FeedbackModel(); if (lstVm != null) { msgModel = new FeedbackModel { Items = lstVm, }; return(View(msgModel)); } else { msgModel = new FeedbackModel { Items = null, }; return(View(msgModel)); } }