// GET: ProductContent public async Task <ActionResult> Index(int id) { var userId = Request.IsAuthenticated ? HttpContext.GetUserId() : null; var sections = await SectionExtensions.GetProductSectionAsync(id, userId); return(View(sections)); }
// GET: ProductModel public async Task <ActionResult> Index(int?id) { if (!id.HasValue) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var userId = Request.IsAuthenticated ? User.Identity.GetUserId() : null; var sections = await SectionExtensions.GetProductSectionAsync(id.Value, userId); return(View(sections)); }