public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } PRODUCTTOSLIDER = await _context.PRODUCTTOSLIDERs.FindAsync(id); if (PRODUCTTOSLIDER != null) { _context.PRODUCTTOSLIDERs.Remove(PRODUCTTOSLIDER); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } PRODUCTTOSLIDER = await _context.PRODUCTTOSLIDERs .Include(p => p.product) .Include(p => p.slidNew_Produc).FirstOrDefaultAsync(m => m.ProductId == id); if (PRODUCTTOSLIDER == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } PRODUCTTOSLIDER = await _context.PRODUCTTOSLIDERs .Include(p => p.product) .Include(p => p.slidNew_Produc).FirstOrDefaultAsync(m => m.ProductId == id); if (PRODUCTTOSLIDER == null) { return(NotFound()); } ViewData["ProductId"] = new SelectList(_context.products, "Id", "Id"); ViewData["SlidNew_producId"] = new SelectList(_context.slidNew_Producs, "Id", "Id"); return(Page()); }