public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var stock = await _stockApp.GetEntityById((int)id); if (stock == null) { return(NotFound()); } else { var updateStock = new UpdateStockViewModel { ID = stock.ID, Description = stock.Description }; return(View(updateStock)); } }
public async Task <IActionResult> Index(int stockID, byte type) { var stock = await _iStockApp.GetEntityById(stockID); var productList = await _iStockProductApp.ListByStock(stockID, type); ViewBag.Stock = new StockDataModel() { ID = stock.ID, Description = stock.Description }; ViewBag.Type = type; return(View(productList)); }