public async Task <IActionResult> Edit(int id, [Bind("Id,TagNumber,AssetTypeId,Manufacturer,Model,Description,SerialNumber")] Asset asset)
{
if (id != asset.Id)
{
return(NotFound());
}
if (ModelState.IsValid)
{
try
{
AssetManager.Update(asset);
}
catch (DbUpdateConcurrencyException)
{
if (!AssetExists(asset.Id))
{
return(NotFound());
}
else
{
throw;
}
}
return(RedirectToAction(nameof(Index)));
}
ViewData["AssetTypeId"] = new SelectList(AssetTypeManager.GetAll(), "Id", "Name", asset.AssetTypeId);
return(View(asset));
}