net8.0
v2_52_0-Tests editorconfig yml ec fix yml explicit contents dotnet_diagnostic CA1862 and GetWeekOfYear for WritePDSF gitignore cellInstanceVersion.EdaConnection.PortNumber Added Climatec to Test.cs GetJobIdDirectory Remove and Remove Microsoft.AspNet.WebApi.SelfHost 5-Other-Small
This commit is contained in:
@ -127,7 +127,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
string jobIdDirectory = Path.Combine(_JobIdParentDirectory, _Logistics.JobID);
|
||||
if (!Directory.Exists(jobIdDirectory))
|
||||
_ = Directory.CreateDirectory(jobIdDirectory);
|
||||
if (!Directory.GetDirectories(jobIdDirectory).Any())
|
||||
if (Directory.GetDirectories(jobIdDirectory).Length == 0)
|
||||
File.Copy(reportFullPath, Path.Combine(destinationArchiveDirectory, Path.GetFileName(reportFullPath)));
|
||||
else
|
||||
{
|
||||
|
@ -6,7 +6,6 @@ using Adaptation.Shared.Methods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
|
||||
@ -109,7 +108,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
else
|
||||
{
|
||||
IProcessData iProcessData = new ProcessData(this, _Logistics, results.Item4, _SheetName);
|
||||
if (!iProcessData.Details.Any())
|
||||
if (iProcessData.Details.Count == 0)
|
||||
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
|
||||
string json = iProcessData.Details[0].ToString();
|
||||
string fileName = Path.Combine(_FileConnectorConfiguration.TargetFileLocation, $"{Path.GetFileNameWithoutExtension(reportFullPath)} - {_SheetName}{_FileConnectorConfiguration.TargetFileName}");
|
||||
|
@ -160,7 +160,7 @@ public class ProcessData : IProcessData
|
||||
if (!fileRead.IsEAFHosted)
|
||||
File.WriteAllText(".json", json);
|
||||
JsonElement[]? jsonElements = JsonSerializer.Deserialize<JsonElement[]>(json, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
|
||||
if (jsonElements is null || !jsonElements.Any())
|
||||
if (jsonElements is null || jsonElements.Length == 0)
|
||||
throw new NullReferenceException();
|
||||
if (!fileRead.ReportFullPath.Contains("Backlog"))
|
||||
json = JsonSerializer.Serialize(jsonElements, new JsonSerializerOptions() { WriteIndented = true });
|
||||
|
@ -157,7 +157,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
if (!Directory.Exists(inProcessDirectory))
|
||||
_ = Directory.CreateDirectory(inProcessDirectory);
|
||||
files = Directory.GetFiles(inProcessDirectory, "*", SearchOption.AllDirectories);
|
||||
if (files.Any())
|
||||
if (files.Length != 0)
|
||||
{
|
||||
if (files.Length > 250)
|
||||
throw new Exception("Safety net!");
|
||||
|
@ -6,7 +6,6 @@ using Adaptation.Shared.Methods;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
@ -129,7 +128,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
for (int i = 0; i < int.MaxValue; i++)
|
||||
{
|
||||
found = Directory.GetFiles(searchDirectory, fileName, SearchOption.AllDirectories);
|
||||
if (found.Any())
|
||||
if (found.Length != 0)
|
||||
{
|
||||
results.AddRange(found);
|
||||
break;
|
||||
@ -205,7 +204,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
}
|
||||
if (postCollection.Any())
|
||||
if (postCollection.Count != 0)
|
||||
{
|
||||
Thread.Sleep(500);
|
||||
StringBuilder stringBuilder = new();
|
||||
|
@ -10,7 +10,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
@ -182,7 +181,7 @@ public class FileRead : Shared.FileRead, IFileRead
|
||||
forceDeleteUpdatedBy);
|
||||
if (iProcessData is not ProcessData _)
|
||||
throw new Exception(string.Concat("A) No Data - ", dateTime.Ticks));
|
||||
if (!iProcessData.Details.Any())
|
||||
if (iProcessData.Details.Count == 0)
|
||||
throw new Exception(string.Concat("B) No Data - ", dateTime.Ticks));
|
||||
results = iProcessData.GetResults(this, _Logistics, results.Item4);
|
||||
Json = json;
|
||||
|
@ -81,7 +81,7 @@ public class ProcessData : IProcessData
|
||||
string key;
|
||||
FIBacklogMesa[]? fiBacklogMesaCollection;
|
||||
fiBacklogMesaCollection = JsonSerializer.Deserialize<FIBacklogMesa[]>(json, new JsonSerializerOptions() { PropertyNameCaseInsensitive = true });
|
||||
if (fiBacklogMesaCollection is null || !fiBacklogMesaCollection.Any())
|
||||
if (fiBacklogMesaCollection is null || fiBacklogMesaCollection.Length == 0)
|
||||
throw new NullReferenceException();
|
||||
foreach (FIBacklogMesa fiBacklogMesa in fiBacklogMesaCollection)
|
||||
{
|
||||
@ -138,7 +138,7 @@ public class ProcessData : IProcessData
|
||||
if (!fileRead.IsEAFHosted)
|
||||
File.WriteAllText("../../example.json", jsonElement.Value.EnumerateObject().Last().Value.ToString());
|
||||
results = JsonSerializer.Deserialize<Value[]>(jsonElement.Value.EnumerateObject().Last().Value);
|
||||
if (results is null || !results.Any())
|
||||
if (results is null || results.Length == 0)
|
||||
throw new NullReferenceException(nameof(results));
|
||||
return results;
|
||||
}
|
||||
@ -726,7 +726,7 @@ public class ProcessData : IProcessData
|
||||
string forceUpdatedByComment = "Force updated by";
|
||||
string? directory = Path.GetDirectoryName(fileRead.ReportFullPath) ?? throw new Exception();
|
||||
string[] checkFiles = Directory.GetFiles(directory, "*.csv", SearchOption.TopDirectoryOnly);
|
||||
if (checkFiles.Any())
|
||||
if (checkFiles.Length != 0)
|
||||
UpdateIds(httpClient, basePage, api, checkFiles);
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user