mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Show products in USB vendor details.
This commit is contained in:
@@ -15,7 +15,8 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
public UsbVendorsController(DicServerContext context) => _context = context;
|
||||
|
||||
// GET: Admin/UsbVendors
|
||||
public async Task<IActionResult> Index() => View(await _context.UsbVendors.OrderBy(v => v.Vendor).ThenBy(v => v.VendorId).ToListAsync());
|
||||
public async Task<IActionResult> Index() =>
|
||||
View(await _context.UsbVendors.OrderBy(v => v.Vendor).ThenBy(v => v.VendorId).ToListAsync());
|
||||
|
||||
// GET: Admin/UsbVendors/Details/5
|
||||
public async Task<IActionResult> Details(int? id)
|
||||
@@ -32,7 +33,20 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
return View(usbVendor);
|
||||
return View(new UsbVendorModel
|
||||
{
|
||||
Vendor = usbVendor.Vendor, VendorId = usbVendor.VendorId, Products = _context.
|
||||
UsbProducts.
|
||||
Where(p => p.VendorId ==
|
||||
usbVendor.Id).
|
||||
OrderBy(p => p.Product).
|
||||
ThenBy(p => p.ProductId).
|
||||
Select(p => new UsbProductModel
|
||||
{
|
||||
ProductId = p.ProductId,
|
||||
ProductName = p.Product
|
||||
}).ToList()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user