public ActionResult Index(string articleId) { int id = int.Parse(articleId); var Article = db.Articles .Where(x => x.Id == id) .Include(x => x.Type) .Include(x => x.Author) .Include(x => x.Ingridients) .First(); using (db) { var comms = db.Comments .Where(r => r.ArticleId == Article.Id) .Where(x => !x.IsDeleted) .Include(x => x.Author); CommentList model = new CommentList() { Comments = comms.ToArray() }; ViewBag.ArticleId = articleId; ViewData["Article"] = Article; return View(model); } }
public ActionResult Index(string requestSolutionId) { int id = int.Parse(requestSolutionId); var requestSolution = db.RequestSolutions .Where(x=>x.Id==id) .Include(x=>x.Document) .Include(x => x.Author) .First(); using (db) { var comms= db.Comments .Where(r => r.ReqId == requestSolution.Id) .Where(x => !x.IsDeleted) .Include(x => x.Author); CommentList model = new CommentList() { Comments = comms.ToArray() }; ViewBag.requestSolutionId = requestSolutionId; ViewData["MathTaskSolution"] = requestSolution; return View(model); } }
public ActionResult Index(string requestId) { int id = int.Parse(requestId); var request = db.Requests .Where(x=>x.Id==id) .Where(x => x.IsDeleted==false) .Include(x=>x.Document) .Include(x => x.Category) .Include(x => x.Subject) .Include(x => x.Author) .Include(x => x.Executor) .First(); using (db) { var comms= db.Comments .Where(r => r.RequestId == request.Id) .Where(x => !x.IsDeleted) .Include(x => x.Author); CommentList model = new CommentList() { Comments = comms.ToArray() }; ViewBag.requestId = requestId; ViewData["Request"] = request; return View(model); } }