示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("SupplierId,CompanyName,ContactName,ContactTitle,Address,City,Region,PostalCode,Country,Phone,Fax,HomePage")] Suppliers suppliers)
        {
            if (id != suppliers.SupplierId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try {
                    await _supplierService.UpdateAsync(suppliers);
                } catch (DbUpdateConcurrencyException) {
                    if (!await _supplierService.ExistAsync(suppliers.SupplierId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(suppliers));
        }