public Category GetCategoryByName(string name) { return(CategoryDA.GetAll().Where(t => t.CategoryName.ToLower().Contains(name.ToLower())).FirstOrDefault()); }
public Category GetCategoryById(int id) { return(CategoryDA.GetAll().Where(t => t.Id == id).FirstOrDefault()); }
//Phương thức lấy hết dữ liệu public List <Category> GetAll() { return(categoryDA.GetAll()); }
public IEnumerable <Category> GetCategories() { return(CategoryDA.GetAll()); }
public ActionResult GetAll(string key) { var obj = key != Keyapi ? new List <CategoryItem>() : _da.GetAll(); return(Json(obj, JsonRequestBehavior.AllowGet)); }