// GET: Category public ActionResult Index() { //After Category CRUD operations Remove Category Cache CatagoryCacheHelper.RemoveCategoryListFromCache(); return(View(CatagoryCacheHelper.GetCategoriesFromCache()));//Get Category With Cache Operations //return View(_categoryService.GetAllCategories().ToList());//without cache }
// GET: Note public ActionResult Index() { //Remove Category Cache CatagoryCacheHelper.RemoveCategoryListFromCache(); var notes = _noteService.GetAllNotes(includeProperties: "Category,User"); return(View(notes.ToList())); }
//Get All Category for left side menu public ActionResult GetAllCategories() { //IQueryable<Category> categories = _categoryService.GetAllCategories().AsQueryable(); //ViewBag.GetAllCategoriesForPartialView = categories; ViewBag.GetAllCategoriesForPartialView = CatagoryCacheHelper.GetCategoriesFromCache(); return(PartialView("GetAllCategories")); }
public ActionResult NoteDetails(Note note) { if (ModelState.IsValid) { _noteService.UpdateNote(note); return(RedirectToAction("NoteDetails", note.NoteId)); } ViewBag.CategoryId = new SelectList(CatagoryCacheHelper.GetCategoriesFromCache(), "CategoryId", "Title"); ViewBag.UserId = new SelectList(_userService.GetAllUser(), "UserId", "Name"); return(View(note)); }
public ActionResult NoteDetails(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Note note = _noteService.GetNoteByIdInclude((long)id); if (note == null) { return(HttpNotFound()); } ViewBag.CategoryId = new SelectList(CatagoryCacheHelper.GetCategoriesFromCache(), "CategoryId", "Title"); ViewBag.UserId = new SelectList(_userService.GetAllUser(), "UserId", "Name"); return(View(note)); }
// GET: Note/Create public ActionResult Create() { ViewBag.CategoryId = new SelectList(CatagoryCacheHelper.GetCategoriesFromCache(), "CategoryId", "Title"); ViewBag.UserId = new SelectList(_userService.GetAllUser(), "UserId", "Name"); return(View()); }