public IActionResult Contact() { ViewData["Message"] = "Your contact page."; var cat = CategoryBl.SingleOrDefault(x => x.Id == 1); var catwithSUb = CategoryBl.SingleOrDefault(x => x.Id == 1, x => x.TblSubCategory); return(View()); }
public IHttpActionResult Get(int id) { var itemResult = CategoryBl.SingleOrDefault(x => x.Id == id, x => x.tblSubCategories); dynamic d = new ExpandoObject(); d.Id = itemResult.Id; d.Name = itemResult.Name; d.Description = itemResult.Description; return(Json(d)); }
public ActionResult <string> Get(int id) { var itemResult = CategoryBl.SingleOrDefault(x => x.Id == id); return(new JsonResult(itemResult)); }