private record

This commit is contained in:
Mike Phares 2024-10-19 09:32:22 -07:00
parent 0ee1846c72
commit 19326df4c6
27 changed files with 206 additions and 168 deletions

5
.vscode/tasks.json vendored
View File

@ -132,6 +132,11 @@
"type": "shell",
"command": "L:/DevOps/Mesa_FI/File-Folder-Helper/bin/Release/net8.0/win-x64/publish/File-Folder-Helper.exe",
"args": [
"s",
"X",
"T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG",
"Day-Helper-2024-01-08",
"T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG/Adaptation/FileHandlers/Kanban",
"s",
"X",
"T:/MESAFIBACKLOG/06_SourceCode/MESAFIBACKLOG",

View File

@ -1,4 +1,3 @@
using File_Folder_Helper.Models;
using Microsoft.Extensions.Logging;
using System.Collections.ObjectModel;
using System.Text;
@ -10,6 +9,29 @@ namespace File_Folder_Helper.ADO2024.PI1;
internal static partial class Helper20240106
{
private record Host([property: JsonPropertyName("a")] string? Id,
[property: JsonPropertyName("b")] string? Colon,
[property: JsonPropertyName("c")] string? Hyphen,
[property: JsonPropertyName("d")] string? Line,
[property: JsonPropertyName("e")] string? Count,
[property: JsonPropertyName("f")] string? Segments,
[property: JsonPropertyName("g")] string? Type,
[property: JsonPropertyName("h")] string? Device,
[property: JsonPropertyName("i")] string? Name,
[property: JsonPropertyName("j")] string? Location);
[JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)]
[JsonSerializable(typeof(Host[]))]
private partial class HostCollectionSourceGenerationContext : JsonSerializerContext
{
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Dictionary<string, Dictionary<string, string>>))]
private partial class DictionaryDictionarySourceGenerationContext : JsonSerializerContext
{
}
private record Record(string Key, Dictionary<string, string> KeyValuePairs);
private static Dictionary<string, Dictionary<string, string>> GetKeyValuePairs(List<Record> collection, bool replaceFound)
@ -33,7 +55,7 @@ internal static partial class Helper20240106
Dictionary<int, Host> results = [];
int id;
string json = $"[{File.ReadAllText(jsonl).Replace("\r\n", ",")}]";
Host[] hosts = JsonSerializer.Deserialize(json, HostSourceGenerationContext.Default.HostArray) ?? throw new NullReferenceException(nameof(json));
Host[] hosts = JsonSerializer.Deserialize(json, HostCollectionSourceGenerationContext.Default.HostArray) ?? throw new NullReferenceException(nameof(json));
foreach (Host host in hosts)
{
if (host.Id is null)
@ -182,12 +204,6 @@ internal static partial class Helper20240106
File.AppendAllLines(hostConfFile, lines);
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Dictionary<string, Dictionary<string, string>>))]
private partial class DictionaryDictionarySourceGenerationContext : JsonSerializerContext
{
}
internal static void TextToJson(ILogger<Worker> logger, List<string> args)
{
string json;

View File

@ -7,7 +7,7 @@ namespace File_Folder_Helper.ADO2024.PI1;
internal static partial class Helper20240409
{
internal record FsSize( // cSpell:disable
private record FsSize( // cSpell:disable
[property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("object")] string Object,
[property: JsonPropertyName("pmon")] string PMon,
@ -19,7 +19,7 @@ internal static partial class Helper20240409
[JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)]
[JsonSerializable(typeof(FsSize))]
internal partial class FsSizeSourceGenerationContext : JsonSerializerContext
private partial class FsSizeSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -9,7 +9,7 @@ namespace File_Folder_Helper.ADO2024.PI1;
internal static partial class Helper20240427
{
internal record Asset( // cSpell:disable
private record Asset( // cSpell:disable
[property: JsonPropertyName("id")] string? Id,
[property: JsonPropertyName("deviceAssetId")] string? DeviceAssetId,
[property: JsonPropertyName("ownerId")] string? OwnerId,
@ -42,7 +42,7 @@ internal static partial class Helper20240427
[JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)]
[JsonSerializable(typeof(List<Asset>))]
internal partial class AssetCollectionSourceGenerationContext : JsonSerializerContext
private partial class AssetCollectionSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -8,26 +8,26 @@ namespace File_Folder_Helper.ADO2024.PI2;
internal static partial class Helper20240517
{
public record ContentSignature([property: JsonPropertyName("contentSignature")] string Value,
private record ContentSignature([property: JsonPropertyName("contentSignature")] string Value,
[property: JsonPropertyName("contentSignatureType")] string ContentSignatureType);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ContentSignature))]
public partial class ContentSignatureGenerationContext : JsonSerializerContext
private partial class ContentSignatureGenerationContext : JsonSerializerContext
{
}
public record Type([property: JsonPropertyName("count")] int Count,
private record Type([property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("match")] string Match,
[property: JsonPropertyName("searchData")] SearchData SearchData);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Type))]
public partial class TypeGenerationContext : JsonSerializerContext
private partial class TypeGenerationContext : JsonSerializerContext
{
}
public record ImageAmazon([property: JsonPropertyName("colorSpace")] string ColorSpace,
private record ImageAmazon([property: JsonPropertyName("colorSpace")] string ColorSpace,
[property: JsonPropertyName("dateTime")] DateTime DateTime,
[property: JsonPropertyName("dateTimeDigitized")] DateTime DateTimeDigitized,
[property: JsonPropertyName("dateTimeOriginal")] DateTime DateTimeOriginal,
@ -54,11 +54,11 @@ internal static partial class Helper20240517
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ImageAmazon))]
public partial class ImageAmazonGenerationContext : JsonSerializerContext
private partial class ImageAmazonGenerationContext : JsonSerializerContext
{
}
public record ContentProperties([property: JsonPropertyName("contentDate")] DateTime ContentDate,
private record ContentProperties([property: JsonPropertyName("contentDate")] DateTime ContentDate,
[property: JsonPropertyName("contentSignatures")] IReadOnlyList<ContentSignature> ContentSignatures,
[property: JsonPropertyName("contentType")] string ContentType,
[property: JsonPropertyName("extension")] string Extension,
@ -69,19 +69,19 @@ internal static partial class Helper20240517
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ContentProperties))]
public partial class ContentPropertiesGenerationContext : JsonSerializerContext
private partial class ContentPropertiesGenerationContext : JsonSerializerContext
{
}
public record XAccntParentMap();
private record XAccntParentMap();
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(XAccntParentMap))]
public partial class XAccntParentMapGenerationContext : JsonSerializerContext
private partial class XAccntParentMapGenerationContext : JsonSerializerContext
{
}
public record Datum([property: JsonPropertyName("accessRuleIds")] IReadOnlyList<object> AccessRuleIds,
private record Datum([property: JsonPropertyName("accessRuleIds")] IReadOnlyList<object> AccessRuleIds,
[property: JsonPropertyName("childAssetTypeInfo")] IReadOnlyList<object> ChildAssetTypeInfo,
[property: JsonPropertyName("contentProperties")] ContentProperties ContentProperties,
[property: JsonPropertyName("createdBy")] string CreatedBy,
@ -111,27 +111,27 @@ internal static partial class Helper20240517
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Datum))]
public partial class DatumGenerationContext : JsonSerializerContext
private partial class DatumGenerationContext : JsonSerializerContext
{
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Dictionary<string, Datum>))]
public partial class DictionaryDatumGenerationContext : JsonSerializerContext
private partial class DictionaryDatumGenerationContext : JsonSerializerContext
{
}
public record LocationAmazon([property: JsonPropertyName("count")] int Count,
private record LocationAmazon([property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("match")] string Match,
[property: JsonPropertyName("searchData")] SearchData SearchData);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(LocationAmazon))]
public partial class LocationAmazonGenerationContext : JsonSerializerContext
private partial class LocationAmazonGenerationContext : JsonSerializerContext
{
}
public record LocationInfo([property: JsonPropertyName("city")] string City,
private record LocationInfo([property: JsonPropertyName("city")] string City,
[property: JsonPropertyName("country")] string Country,
[property: JsonPropertyName("countryIso3Code")] string CountryIso3Code,
[property: JsonPropertyName("state")] string State,
@ -139,74 +139,74 @@ internal static partial class Helper20240517
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(LocationInfo))]
public partial class LocationInfoGenerationContext : JsonSerializerContext
private partial class LocationInfoGenerationContext : JsonSerializerContext
{
}
public record SearchData([property: JsonPropertyName("clusterName")] string ClusterName,
private record SearchData([property: JsonPropertyName("clusterName")] string ClusterName,
[property: JsonPropertyName("locationId")] string LocationId,
[property: JsonPropertyName("locationInfo")] LocationInfo LocationInfo,
[property: JsonPropertyName("thingId")] string ThingId);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(SearchData))]
public partial class SearchDataGenerationContext : JsonSerializerContext
private partial class SearchDataGenerationContext : JsonSerializerContext
{
}
public record AllPerson([property: JsonPropertyName("count")] int Count,
private record AllPerson([property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("match")] string Match,
[property: JsonPropertyName("searchData")] SearchData SearchData);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(AllPerson))]
public partial class AllPersonGenerationContext : JsonSerializerContext
private partial class AllPersonGenerationContext : JsonSerializerContext
{
}
public record PersonAmazon([property: JsonPropertyName("count")] int Count,
private record PersonAmazon([property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("match")] string Match,
[property: JsonPropertyName("searchData")] SearchData SearchData);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(PersonAmazon))]
public partial class PersonAmazonGenerationContext : JsonSerializerContext
private partial class PersonAmazonGenerationContext : JsonSerializerContext
{
}
public record ClusterId([property: JsonPropertyName("count")] int Count,
private record ClusterId([property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("match")] string Match,
[property: JsonPropertyName("searchData")] SearchData SearchData);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ClusterId))]
public partial class ClusterIdGenerationContext : JsonSerializerContext
private partial class ClusterIdGenerationContext : JsonSerializerContext
{
}
public record Thing([property: JsonPropertyName("count")] int Count,
private record Thing([property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("match")] string Match,
[property: JsonPropertyName("searchData")] SearchData SearchData);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Thing))]
public partial class ThingGenerationContext : JsonSerializerContext
private partial class ThingGenerationContext : JsonSerializerContext
{
}
public record Time([property: JsonPropertyName("count")] int Count,
private record Time([property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("match")] string Match,
[property: JsonPropertyName("searchData")] SearchData SearchData);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Time))]
public partial class TimeGenerationContext : JsonSerializerContext
private partial class TimeGenerationContext : JsonSerializerContext
{
}
public record ParentMap([property: JsonPropertyName("FOLDER")] IReadOnlyList<string> FOLDER);
private record ParentMap([property: JsonPropertyName("FOLDER")] IReadOnlyList<string> FOLDER);
public record Aggregations([property: JsonPropertyName("allPeople")] IReadOnlyList<AllPerson> AllPeople,
private record Aggregations([property: JsonPropertyName("allPeople")] IReadOnlyList<AllPerson> AllPeople,
[property: JsonPropertyName("clusterId")] IReadOnlyList<ClusterId> ClusterId,
[property: JsonPropertyName("location")] IReadOnlyList<LocationAmazon> Location,
[property: JsonPropertyName("people")] IReadOnlyList<PersonAmazon> People,
@ -216,23 +216,23 @@ internal static partial class Helper20240517
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Aggregations))]
public partial class AggregationsGenerationContext : JsonSerializerContext
private partial class AggregationsGenerationContext : JsonSerializerContext
{
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ParentMap))]
public partial class ParentMapGenerationContext : JsonSerializerContext
private partial class ParentMapGenerationContext : JsonSerializerContext
{
}
public record RootAmazon([property: JsonPropertyName("aggregations")] Aggregations Aggregations,
private record RootAmazon([property: JsonPropertyName("aggregations")] Aggregations Aggregations,
[property: JsonPropertyName("count")] int Count,
[property: JsonPropertyName("data")] IReadOnlyList<Datum> Data);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(RootAmazon))]
public partial class RootAmazonGenerationContext : JsonSerializerContext
private partial class RootAmazonGenerationContext : JsonSerializerContext
{
}

View File

@ -1,20 +1,37 @@
using File_Folder_Helper.Models;
using Microsoft.Extensions.Logging;
using System.Collections.ObjectModel;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace File_Folder_Helper.ADO2024.PI2;
internal static partial class Helper20240718
{
private record Host([property: JsonPropertyName("a")] string? Id,
[property: JsonPropertyName("b")] string? Colon,
[property: JsonPropertyName("c")] string? Hyphen,
[property: JsonPropertyName("d")] string? Line,
[property: JsonPropertyName("e")] string? Count,
[property: JsonPropertyName("f")] string? Segments,
[property: JsonPropertyName("g")] string? Type,
[property: JsonPropertyName("h")] string? Device,
[property: JsonPropertyName("i")] string? Name,
[property: JsonPropertyName("j")] string? Location);
[JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)]
[JsonSerializable(typeof(Host[]))]
private partial class HostsSourceGenerationContext : JsonSerializerContext
{
}
private static Host[] GetHosts(ILogger<Worker> logger, string file)
{
Host[] results;
string lines = File.ReadAllText(file);
string json = $"[{lines.Replace("\r\n", ",")}]";
logger.LogDebug(lines);
results = JsonSerializer.Deserialize(json, HostSourceGenerationContext.Default.HostArray) ?? throw new NullReferenceException();
results = JsonSerializer.Deserialize(json, HostsSourceGenerationContext.Default.HostArray) ?? throw new NullReferenceException();
return results;
}

View File

@ -8,62 +8,62 @@ namespace File_Folder_Helper.ADO2024.PI3;
internal static partial class Helper20240822
{
public record Record(string? Title, ReadOnlyCollection<string> Tags, string? Completed);
private record Record(string? Title, ReadOnlyCollection<string> Tags, string? Completed);
public record Root([property: JsonPropertyName("headings")] Heading[] Headings,
[property: JsonPropertyName("lanes")] Lane[] Lanes);
private record Root([property: JsonPropertyName("headings")] Heading[] Headings,
[property: JsonPropertyName("lanes")] Lane[] Lanes);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Root))]
internal partial class Helper20240822RootSourceGenerationContext : JsonSerializerContext
private partial class Helper20240822RootSourceGenerationContext : JsonSerializerContext
{
}
public record Welcome2([property: JsonPropertyName("headings")] Heading[] Headings,
[property: JsonPropertyName("lanes")] Lane[] Lanes);
private record Welcome2([property: JsonPropertyName("headings")] Heading[] Headings,
[property: JsonPropertyName("lanes")] Lane[] Lanes);
public record Heading([property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("heading")] string HeadingHeading);
private record Heading([property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("heading")] string HeadingHeading);
public record Lane([property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("columns")] Column[][] Columns);
private record Lane([property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("columns")] Column[][] Columns);
public record Column([property: JsonPropertyName("id")] string Id,
[property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("description")] string Description,
[property: JsonPropertyName("metadata")] Metadata? Metadata,
[property: JsonPropertyName("subTasks")] SubTask[]? SubTasks,
[property: JsonPropertyName("relations")] object[] Relations,
[property: JsonPropertyName("comments")] Comment[] Comments,
[property: JsonPropertyName("column")] string ColumnColumn,
[property: JsonPropertyName("workload")] long Workload,
[property: JsonPropertyName("progress")] long Progress,
[property: JsonPropertyName("remainingWorkload")] long RemainingWorkload,
[property: JsonPropertyName("dueData")] DueData DueData);
private record Column([property: JsonPropertyName("id")] string Id,
[property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("description")] string Description,
[property: JsonPropertyName("metadata")] Metadata? Metadata,
[property: JsonPropertyName("subTasks")] SubTask[]? SubTasks,
[property: JsonPropertyName("relations")] object[] Relations,
[property: JsonPropertyName("comments")] Comment[] Comments,
[property: JsonPropertyName("column")] string ColumnColumn,
[property: JsonPropertyName("workload")] long Workload,
[property: JsonPropertyName("progress")] long Progress,
[property: JsonPropertyName("remainingWorkload")] long RemainingWorkload,
[property: JsonPropertyName("dueData")] DueData DueData);
public record Comment([property: JsonPropertyName("text")] string Text,
[property: JsonPropertyName("date")] DateTimeOffset Date);
private record Comment([property: JsonPropertyName("text")] string Text,
[property: JsonPropertyName("date")] DateTimeOffset Date);
public record DueData([property: JsonPropertyName("completed")] bool Completed,
[property: JsonPropertyName("completedDate")] object CompletedDate,
[property: JsonPropertyName("dueDate")] DateTimeOffset DueDate,
[property: JsonPropertyName("overdue")] bool Overdue,
[property: JsonPropertyName("dueDelta")] long DueDelta,
[property: JsonPropertyName("dueMessage")] string DueMessage);
private record DueData([property: JsonPropertyName("completed")] bool Completed,
[property: JsonPropertyName("completedDate")] object CompletedDate,
[property: JsonPropertyName("dueDate")] DateTimeOffset DueDate,
[property: JsonPropertyName("overdue")] bool Overdue,
[property: JsonPropertyName("dueDelta")] long DueDelta,
[property: JsonPropertyName("dueMessage")] string DueMessage);
public record Metadata([property: JsonPropertyName("assigned")] string Assigned,
[property: JsonPropertyName("created")] DateTimeOffset Created,
[property: JsonPropertyName("progress")] long? Progress,
[property: JsonPropertyName("started")] DateTimeOffset? Started,
[property: JsonPropertyName("status")] string? Status,
[property: JsonPropertyName("tags")] string[]? Tags,
[property: JsonPropertyName("type")] string? Type,
[property: JsonPropertyName("updated")] DateTimeOffset Updated,
[property: JsonPropertyName("due")] DateTimeOffset? Due,
[property: JsonPropertyName("completed")] DateTimeOffset? Completed);
private record Metadata([property: JsonPropertyName("assigned")] string Assigned,
[property: JsonPropertyName("created")] DateTimeOffset Created,
[property: JsonPropertyName("progress")] long? Progress,
[property: JsonPropertyName("started")] DateTimeOffset? Started,
[property: JsonPropertyName("status")] string? Status,
[property: JsonPropertyName("tags")] string[]? Tags,
[property: JsonPropertyName("type")] string? Type,
[property: JsonPropertyName("updated")] DateTimeOffset Updated,
[property: JsonPropertyName("due")] DateTimeOffset? Due,
[property: JsonPropertyName("completed")] DateTimeOffset? Completed);
public record SubTask([property: JsonPropertyName("text")] string Text,
[property: JsonPropertyName("completed")] bool Completed);
private record SubTask([property: JsonPropertyName("text")] string Text,
[property: JsonPropertyName("completed")] bool Completed);
private static ReadOnlyCollection<ReadOnlyCollection<Record>> GetRecords(Column[][] columnCollection)
{

View File

@ -10,24 +10,24 @@ namespace File_Folder_Helper.ADO2024.PI3;
internal static partial class Helper20240828
{
public record HeaderCommon(DateTime Date,
string? Employee,
string? Layer,
string? MesEntity,
string? PSN,
string? Quantity,
string? RDS,
string? Reactor,
string? Recipe,
string? Zone);
private record HeaderCommon(DateTime Date,
string? Employee,
string? Layer,
string? MesEntity,
string? PSN,
string? Quantity,
string? RDS,
string? Reactor,
string? Recipe,
string? Zone);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(HeaderCommon))]
internal partial class HeaderCommonSourceGenerationContext : JsonSerializerContext
private partial class HeaderCommonSourceGenerationContext : JsonSerializerContext
{
}
public record Record(string? CassetteId,
private record Record(string? CassetteId,
ReadOnlyCollection<string>? CassetteSegments,
DateTime? Date,
string? Employee,

View File

@ -15,7 +15,7 @@ namespace File_Folder_Helper.ADO2024.PI3;
internal static partial class Helper20240830
{
public record WorkItem(string AreaPath,
private record WorkItem(string AreaPath,
string? AssignedTo,
int? BusinessValue,
DateTime ChangedDate,

View File

@ -7,12 +7,12 @@ namespace File_Folder_Helper.ADO2024.PI3;
internal static partial class Helper20240925
{
public record Test(string Name,
long Value);
private record Test(string Name,
long Value);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ReadOnlyCollection<Test>))]
internal partial class TestCollectionSourceGenerationContext : JsonSerializerContext
private partial class TestCollectionSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -7,17 +7,17 @@ namespace File_Folder_Helper.ADO2024.PI3;
internal static partial class Helper20241002
{
public record Record(string? Calculation,
string Chart,
string Group,
string GroupId,
long Id,
string? RawCalculation,
string Test,
string TestId)
private record Record(string? Calculation,
string Chart,
string Group,
string GroupId,
long Id,
string? RawCalculation,
string Test,
string TestId)
{
public static Record Get(Record record, string? calculation) =>
internal static Record Get(Record record, string? calculation) =>
new(calculation,
record.Chart,
record.Group,
@ -31,13 +31,13 @@ internal static partial class Helper20241002
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ReadOnlyCollection<Record>))]
internal partial class RecordCollectionSourceGenerationContext : JsonSerializerContext
private partial class RecordCollectionSourceGenerationContext : JsonSerializerContext
{
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(ReadOnlyDictionary<string, Record>))]
internal partial class RecordDictionarySourceGenerationContext : JsonSerializerContext
private partial class RecordDictionarySourceGenerationContext : JsonSerializerContext
{
}

View File

@ -79,8 +79,8 @@ internal static class HelperDay
ADO2024.PI2.Helper20240624.MoveUpOneDirectory(logger, args);
else if (args[1] == "Day-Helper-2024-07-11")
ADO2024.PI2.Helper20240711.GitRemoteRemove(logger, args);
else if (args[1] == "Day-Helper-2024-07-18")
ADO2024.PI2.Helper20240718.JsonToMarkdown(logger, args);
// else if (args[1] == "Day-Helper-2024-07-18")
// ADO2024.PI2.Helper20240718.JsonToMarkdown(logger, args);
else if (args[1] == "Day-Helper-2024-07-24")
ADO2024.PI2.Helper20240724.CopyDirectories(logger, args);
else if (args[1] == "Day-Helper-2024-07-28")

View File

@ -6,13 +6,25 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Day.Q42023;
internal record Drive(string Share,
bool Use,
string User);
internal static class Helper20231024
internal static partial class Helper20231024
{
private record Drive(string Share,
bool Use,
string User);
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Drive))]
private partial class DriveSourceGenerationContext : JsonSerializerContext
{
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(List<Drive>))]
private partial class DrivesSourceGenerationContext : JsonSerializerContext
{
}
internal static void NetUse(ILogger<Worker> logger, string argsZero)
{
Process? process;
@ -111,15 +123,3 @@ internal static class Helper20231024
}
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Drive))]
internal partial class DriveSourceGenerationContext : JsonSerializerContext
{
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(List<Drive>))]
internal partial class DrivesSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -28,7 +28,7 @@ internal static partial class Helper20231222
string NameWithoutExtension,
int? SortOrder);
public record MetadataConfiguration(int ResultAllInOneSubdirectoryLength, int Offset, int IntMinValueLength);
private record MetadataConfiguration(int ResultAllInOneSubdirectoryLength, int Offset, int IntMinValueLength);
private static short GetSortOrderOnlyLengthIndex(MetadataConfiguration metadataConfiguration) =>
(short)metadataConfiguration.Offset.ToString().Length;

View File

@ -60,7 +60,7 @@ public class AppSettings
return result;
}
public static Models.AppSettings Get(IConfigurationRoot configurationRoot)
internal static Models.AppSettings Get(IConfigurationRoot configurationRoot)
{
Models.AppSettings result;
#pragma warning disable IL3050, IL2026

View File

@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record Birth(DateOnly? Date,
internal record Birth(DateOnly? Date,
string? Note,
List<string> Continue)
{

View File

@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record Change(DateOnly? Date,
internal record Change(DateOnly? Date,
string? Note,
List<string> Continue)
{

View File

@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record Comment([property: JsonPropertyName("workItemId")] int? WorkItemId,
internal record Comment([property: JsonPropertyName("workItemId")] int? WorkItemId,
[property: JsonPropertyName("id")] int? Id,
[property: JsonPropertyName("version")] int? Version,
[property: JsonPropertyName("text")] string? Text,

View File

@ -4,7 +4,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record CreatedBy([property: JsonPropertyName("displayName")] string? DisplayName,
internal record CreatedBy([property: JsonPropertyName("displayName")] string? DisplayName,
[property: JsonPropertyName("url")] string? Url,
[property: JsonPropertyName("_links")] Links Links,
[property: JsonPropertyName("id")] string? Id,

View File

@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record Death(bool? Is,
internal record Death(bool? Is,
DateOnly? Date,
string? Note,
List<string> Continue)

View File

@ -1,20 +1,20 @@
using System.Text.Json.Serialization;
// using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
// namespace File_Folder_Helper.Models;
public record Host([property: JsonPropertyName("a")] string? Id,
[property: JsonPropertyName("b")] string? Colon,
[property: JsonPropertyName("c")] string? Hyphen,
[property: JsonPropertyName("d")] string? Line,
[property: JsonPropertyName("e")] string? Count,
[property: JsonPropertyName("f")] string? Segments,
[property: JsonPropertyName("g")] string? Type,
[property: JsonPropertyName("h")] string? Device,
[property: JsonPropertyName("i")] string? Name,
[property: JsonPropertyName("j")] string? Location);
// internal record Host([property: JsonPropertyName("a")] string? Id,
// [property: JsonPropertyName("b")] string? Colon,
// [property: JsonPropertyName("c")] string? Hyphen,
// [property: JsonPropertyName("d")] string? Line,
// [property: JsonPropertyName("e")] string? Count,
// [property: JsonPropertyName("f")] string? Segments,
// [property: JsonPropertyName("g")] string? Type,
// [property: JsonPropertyName("h")] string? Device,
// [property: JsonPropertyName("i")] string? Name,
// [property: JsonPropertyName("j")] string? Location);
[JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)]
[JsonSerializable(typeof(Host[]))]
public partial class HostSourceGenerationContext : JsonSerializerContext
{
}
// [JsonSourceGenerationOptions(WriteIndented = true, AllowTrailingCommas = true)]
// [JsonSerializable(typeof(Host[]))]
// internal partial class HostsSourceGenerationContext : JsonSerializerContext
// {
// }

View File

@ -4,7 +4,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record ModifiedBy([property: JsonPropertyName("displayName")] string? DisplayName,
internal record ModifiedBy([property: JsonPropertyName("displayName")] string? DisplayName,
[property: JsonPropertyName("url")] string? Url,
[property: JsonPropertyName("_links")] Links Links,
[property: JsonPropertyName("id")] string? Id,

View File

@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record Name(string? ForwardSlashFull,
internal record Name(string? ForwardSlashFull,
string? Given,
string? Sur,
string? Nick,

View File

@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record NginxFileSystem(string Name,
internal record NginxFileSystem(string Name,
string Type,
string MTime,
float Size)

View File

@ -2,7 +2,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record PackageJson([property: JsonPropertyName("name")] string Name,
internal record PackageJson([property: JsonPropertyName("name")] string Name,
[property: JsonPropertyName("time")] Dictionary<string, DateTime> Times,
[property: JsonPropertyName("_rev")] string Rev,
[property: JsonPropertyName("_id")] string Id);

View File

@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record Person(long Id,
internal record Person(long Id,
Name? Name,
char? Sex,
string? UId,

View File

@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
namespace File_Folder_Helper.Models;
public record VSCodeTask([property: JsonPropertyName("label")] string? Label,
internal record VSCodeTask([property: JsonPropertyName("label")] string? Label,
[property: JsonPropertyName("command")] string? Command,
[property: JsonPropertyName("type")] string? Type,
[property: JsonPropertyName("args")] IReadOnlyList<string>? Arguments,
@ -24,7 +24,7 @@ internal partial class VSCodeTaskSourceGenerationContext : JsonSerializerContext
{
}
public record VSCodeTasks([property: JsonPropertyName("version")] string? Version,
internal record VSCodeTasks([property: JsonPropertyName("version")] string? Version,
[property: JsonPropertyName("tasks")] VSCodeTask[]? TaskCollection)
{