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

            if (category == null)
            {
                return(HttpNotFound());
            }
            return(View(category));
        }
Esempio n. 2
0
        public ActionResult ByCategory(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest));
            }


            Category cat = categoryManager.Find(x => x.Id == id.Value);

            if (cat == null)
            {
                return(HttpNotFound());
            }


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