Updating
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using LCU.Library.Internal.ApiResponse.Models;
|
||||
using LCU.Library.Internal.FileOperationsModels.Enums;
|
||||
|
||||
namespace LCU.Library.Internal.FileOperationsModels.Models.Responses;
|
||||
|
||||
public class FileSizeResponse : ReturnResponse
|
||||
{
|
||||
public string FileName { get; set; } = string.Empty;
|
||||
public decimal FileSize { get; set; }
|
||||
public FileSizeTypes FileSizeType { get; set; }
|
||||
|
||||
[NotMapped]
|
||||
public string FileSizeString
|
||||
{
|
||||
get
|
||||
{
|
||||
var fileSizeType = FileSizeType.GetType().GetMember(FileSizeType.ToString()).First().GetCustomAttribute<DisplayAttribute>()?.Name;
|
||||
return $"{Math.Round(FileSize, 6):0.######} {fileSizeType}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user