81 lines
2.3 KiB
C#
81 lines
2.3 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace AmtScanner.Api.Models;
|
|
|
|
public class HardwareInfo
|
|
{
|
|
[Key]
|
|
public long Id { get; set; }
|
|
|
|
[Required]
|
|
public long DeviceId { get; set; }
|
|
|
|
[Required]
|
|
public DateTime LastUpdated { get; set; }
|
|
|
|
// System Information
|
|
public string? SystemManufacturer { get; set; }
|
|
public string? SystemModel { get; set; }
|
|
public string? SystemSerialNumber { get; set; }
|
|
|
|
// Processor Information
|
|
public string? ProcessorModel { get; set; }
|
|
public int? ProcessorCores { get; set; }
|
|
public int? ProcessorThreads { get; set; }
|
|
public int? ProcessorMaxClockSpeed { get; set; } // MHz
|
|
public int? ProcessorCurrentClockSpeed { get; set; } // MHz
|
|
|
|
// Memory Information
|
|
public long? TotalMemoryBytes { get; set; }
|
|
|
|
public DateTime CreatedAt { get; set; }
|
|
public DateTime UpdatedAt { get; set; }
|
|
|
|
// Navigation properties
|
|
[ForeignKey("DeviceId")]
|
|
public AmtDevice Device { get; set; } = null!;
|
|
|
|
public ICollection<MemoryModule> MemoryModules { get; set; } = new List<MemoryModule>();
|
|
public ICollection<StorageDevice> StorageDevices { get; set; } = new List<StorageDevice>();
|
|
}
|
|
|
|
public class MemoryModule
|
|
{
|
|
[Key]
|
|
public long Id { get; set; }
|
|
|
|
[Required]
|
|
public long HardwareInfoId { get; set; }
|
|
|
|
public string? SlotLocation { get; set; }
|
|
public long? CapacityBytes { get; set; }
|
|
public int? SpeedMHz { get; set; }
|
|
public string? MemoryType { get; set; }
|
|
public string? Manufacturer { get; set; }
|
|
public string? PartNumber { get; set; }
|
|
public string? SerialNumber { get; set; }
|
|
|
|
// Navigation property
|
|
[ForeignKey("HardwareInfoId")]
|
|
public HardwareInfo HardwareInfo { get; set; } = null!;
|
|
}
|
|
|
|
public class StorageDevice
|
|
{
|
|
[Key]
|
|
public long Id { get; set; }
|
|
|
|
[Required]
|
|
public long HardwareInfoId { get; set; }
|
|
|
|
public string? DeviceId { get; set; }
|
|
public string? Model { get; set; }
|
|
public long? CapacityBytes { get; set; }
|
|
public string? InterfaceType { get; set; }
|
|
|
|
// Navigation property
|
|
[ForeignKey("HardwareInfoId")]
|
|
public HardwareInfo HardwareInfo { get; set; } = null!;
|
|
}
|