public async Task <ActionResult> Index() { try { CategoryModel cat = CategoryEmpty.Empty(); var res = await ImpCat.GetCategoryByCondition(cat); return(View(res)); } catch (Exception ex) { return(HttpNotFound()); } }
public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CategoryModel cat = CategoryEmpty.Empty(); cat.CategoryID = (int)id; var data = await ImpCat.GetCategoryByCondition(cat); if (data != null) { return(View(data)); } else { return(HttpNotFound()); } }