public ActionResult AddCategory(string name) { Advert_Category c = new Advert_Category() { Name = name, }; db.Advert_Category.Add(c); db.SaveChanges(); return(RedirectToAction("Utils")); }
private int getAdvertsCountInCategory(Advert_Category category) { return(db.Advert.Where(x => x.ACCode == category.ACCode).ToList().Count()); }