FileType.cs 671 B

12345678910111213141516171819202122232425262728
  1. namespace HTEX.Complex.Models
  2. {
  3. public class FileType
  4. {
  5. public string Id { get; set; }
  6. public string Extention { get; set; }
  7. public string Type { get; set; }
  8. public FileType(string id, string extention, string type)
  9. {
  10. Id = id;
  11. Extention = extention;
  12. Type = type;
  13. }
  14. public static string GetExtention(string fileName)
  15. {
  16. if (string.IsNullOrEmpty(fileName))
  17. {
  18. return "";
  19. }
  20. else
  21. {
  22. return fileName.Substring(fileName.LastIndexOf(".") + 1);
  23. }
  24. }
  25. }
  26. }