Remove with Text
Remove GetEngineeringSpcReview Better error message EnforceCodeStyleInBuild NginxFileSystem Remove Reactors and Working Directory AppSettings Delete self contained Thunder Tests Back to .net8.0 api/v4/InfinityQS ApiExplorerSettings Wafer Counter
This commit is contained in:
29
Shared/Models/NginxFileSystemSortable.cs
Normal file
29
Shared/Models/NginxFileSystemSortable.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using OI.Metrology.Shared.Models.Stateless;
|
||||
using System.Globalization;
|
||||
|
||||
namespace OI.Metrology.Shared.Models;
|
||||
|
||||
public record NginxFileSystemSortable(DateTime DateTime,
|
||||
Uri Uri,
|
||||
string Name,
|
||||
float Size,
|
||||
string Type)
|
||||
{
|
||||
|
||||
public static List<NginxFileSystemSortable> Convert(IFileShareRepository fileShareRepository, Uri waferSizeUri, NginxFileSystem[]? collection)
|
||||
{
|
||||
List<NginxFileSystemSortable> results = new();
|
||||
NginxFileSystemSortable nginxFileSystemSortable;
|
||||
string nginxFormat = "ddd, dd MMM yyyy HH:mm:ss zzz";
|
||||
foreach (NginxFileSystem nginxFileSystem in collection ?? Array.Empty<NginxFileSystem>())
|
||||
{
|
||||
if (DateTime.TryParseExact(nginxFileSystem.MTime.Replace("GMT", "+00:00"), nginxFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime dateTime))
|
||||
nginxFileSystemSortable = new(dateTime, fileShareRepository.Append(waferSizeUri, nginxFileSystem.Name), nginxFileSystem.Name, nginxFileSystem.Size, nginxFileSystem.Type);
|
||||
else
|
||||
nginxFileSystemSortable = new(DateTime.MinValue, fileShareRepository.Append(waferSizeUri, nginxFileSystem.Name), nginxFileSystem.Name, nginxFileSystem.Size, nginxFileSystem.Type);
|
||||
results.Add(nginxFileSystemSortable);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user