mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
27 lines
1.4 KiB
C#
27 lines
1.4 KiB
C#
using Aaru.Server.Old.Database.Models;
|
|
using DbContext = Aaru.Server.Old.Database.DbContext;
|
|
|
|
namespace Aaru.Server.Old.Areas.Admin.Controllers;
|
|
|
|
[Area("Admin")]
|
|
[Authorize]
|
|
public sealed class UsbProductsController : Controller
|
|
{
|
|
readonly DbContext _context;
|
|
|
|
public UsbProductsController(DbContext context) => _context = context;
|
|
|
|
// GET: Admin/UsbProducts
|
|
public async Task<IActionResult> Index() => View(await _context.UsbProducts.Include(u => u.Vendor)
|
|
.OrderBy(p => p.Vendor.Vendor)
|
|
.ThenBy(p => p.Product)
|
|
.ThenBy(p => p.ProductId)
|
|
.Select(p => new UsbProductModel
|
|
{
|
|
ProductId = p.ProductId,
|
|
ProductName = p.Product,
|
|
VendorId = p.Vendor.Id,
|
|
VendorName = p.Vendor.Vendor
|
|
})
|
|
.ToListAsync());
|
|
} |