SystemEditModel.cs 780 B

12345678910111213141516171819202122232425262728
  1. using RackPeek.Domain.Resources.SystemResources;
  2. namespace Shared.Rcl.Systems;
  3. public sealed class SystemEditModel
  4. {
  5. public string Name { get; init; } = default!;
  6. public string? Type { get; set; }
  7. public string? Os { get; set; }
  8. public int? Cores { get; set; }
  9. public double? Ram { get; set; }
  10. public List<string> RunsOn { get; set; } = new List<string>();
  11. public string? Notes { get; set; }
  12. public static SystemEditModel From(SystemResource system)
  13. {
  14. return new SystemEditModel
  15. {
  16. Name = system.Name,
  17. Type = system.Type,
  18. Os = system.Os,
  19. Cores = system.Cores,
  20. Ram = system.Ram,
  21. RunsOn = system.RunsOn,
  22. Notes = system.Notes
  23. };
  24. }
  25. }