public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Category category = categoryMenager.Find(x => x.Id == id.Value);

            if (category == null)
            {
                return(HttpNotFound());
            }
            return(View(category));
        }
Beispiel #2
0
        public ActionResult ByCategory(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Category cat = categoryMenager.Find(x => x.Id == id.Value);

            if (cat == null)
            {
                return(HttpNotFound());
                //  return RedirectToAction("","")
            }

            return(View("Index", cat.Notes.Where(x => x.IsDraft == false).OrderByDescending(x => x.ModifiedOn).ToList()));
        }