public void Create(string name) { Category category = new Category(); category.Name = name; dbCon.Categories.Add(category); dbCon.SaveChanges(); }
public ActionResult Create() { ViewBag.ParentId = new SelectList(db.Categories, "Id", "Name").InsertEmptyFirst("شاخه اصلی", "0"); Category category = new Category(); category.IconClass = "uk-icon-caret-right"; return View(category); }
public ActionResult ChangeName(Category category) { if (ModelState.IsValid) { category.Name = HttpUtility.HtmlEncode(category.Name); _categoryService.Update(category); } return RedirectToAction("Index"); }
public void Update(Category category) { Category _category = dbCon.Categories.SingleOrDefault(x => x.Id == category.Id); if (_category != null) { _category.Name = category.Name; dbCon.SaveChanges(); } }
public Response() { Users = new List<ApplicationUser>(); IdUserRoles = new List<IdentityUserRole>(); IdRoles = new List<IdentityRole>(); Hashtag = new Hashtag(); Hashtags = new List<Hashtag>(); BlogPost = new BlogPost(); BlogPosts = new List<BlogPost>(); StaticPage = new StaticPage(); StaticPages = new List<StaticPage>(); Category = new Category(); Categories = new List<Category>(); User = new ApplicationUser(); BlogStats = new BlogStats(); }
public ViewCategoryVM() { BlogPosts = new List<BlogPost>(); Categories = new List<Category>(); CurrentCategory = new Category(); }
public void Update(Category category) { _categoryRepository.Update(category); }
public BlogPost() { Hashtags = new List<Hashtag>(); User = new ApplicationUser(); Category = new Category(); }