public async Task <IActionResult> OnPostAsync(int?id) { if (id == null) { return(NotFound()); } StoreProduct = await _storeProductService.GetByIdAsync(id.Value); if (StoreProduct != null) { await _storeProductService.RemoveAsync(StoreProduct); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } StoreProduct = await _storeProductService.GetByIdAsync(id.Value); if (StoreProduct == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } StoreProduct = await _storeProductService.GetByIdAsync(id.Value); if (StoreProduct == null) { return(NotFound()); } ViewData["ProductId"] = new SelectList(await _productService.ListAsync(), "Id", "Name"); ViewData["StoreId"] = new SelectList(await _storeService.ListAsync(), "Id", "Id"); return(Page()); }