Resource.cs 886 B

123456789101112131415161718192021222324252627282930
  1. namespace RackPeek.Domain.Resources;
  2. public abstract class Resource
  3. {
  4. public string Kind { get; set; } = string.Empty;
  5. public required string Name { get; set; }
  6. public Dictionary<string, string>? Tags { get; set; }
  7. public static string KindToPlural(string kind)
  8. {
  9. return KindToPluralDictionary.GetValueOrDefault(kind.ToLower().Trim(), kind);
  10. }
  11. private static readonly Dictionary<string, string> KindToPluralDictionary = new Dictionary<string, string>()
  12. {
  13. { "hardware", "hardware" },
  14. { "server", "servers" },
  15. { "switch", "switches" },
  16. { "firewall", "firewalls" },
  17. { "router", "routers" },
  18. { "accesspoint", "accesspoints" },
  19. { "desktop", "desktops" },
  20. { "laptop", "laptops" },
  21. { "ups", "ups" },
  22. { "system", "systems" },
  23. { "service", "services" },
  24. };
  25. }