public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } CartProduct = await _context.CartProduct .Include(c => c.Cart) .Include(c => c.Product).FirstOrDefaultAsync(m => m.Id == id); if (CartProduct == null) { return(NotFound()); } ViewData["CartId"] = new SelectList(_context.Set <Cart>(), "Id", "Id"); ViewData["ProductId"] = new SelectList(_context.Set <Product>(), "Id", "Id"); return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } Cart = await _context.Cart .Include(c => c.Client).FirstOrDefaultAsync(m => m.Id == id); if (Cart == null) { return(NotFound()); } ViewData["ClientID"] = new SelectList(_context.Set <User>(), "Id", "Id"); return(Page()); }
public IActionResult OnGet() { ViewData["ClientID"] = new SelectList(_context.Set <User>(), "Id", "Id"); return(Page()); }
public IActionResult OnGet() { ViewData["CartId"] = new SelectList(_context.Set <Cart>(), "Id", "Id"); ViewData["ProductId"] = new SelectList(_context.Set <Product>(), "Id", "Id"); return(Page()); }