Optimize USB product entity so calls to update API get reduced.

This commit is contained in:
2025-12-29 12:34:50 +00:00
parent 787279adf6
commit ea2a175e43
5 changed files with 3329 additions and 8 deletions

View File

@@ -40,10 +40,11 @@ public class UsbProduct : BaseModel<int>
public UsbProduct(UsbVendor vendor, ushort id, string product)
{
ProductId = id;
Product = product;
AddedWhen = ModifiedWhen = DateTime.UtcNow;
Vendor = vendor;
ProductId = id;
Product = product;
AddedWhen = ModifiedWhen = DateTime.UtcNow;
Vendor = vendor;
UsbVendorId = vendor.VendorId;
}
public ushort ProductId { get; set; }
@@ -51,6 +52,7 @@ public class UsbProduct : BaseModel<int>
public DateTime AddedWhen { get; set; }
public DateTime ModifiedWhen { get; set; }
public int VendorId { get; set; }
public ushort UsbVendorId { get; set; }
[JsonIgnore]
public virtual UsbVendor Vendor { get; set; }