Creation of ADO Connection

This commit is contained in:
2024-11-08 15:47:49 -07:00
parent 5d9b5a4022
commit 9c5651a862
46 changed files with 1094 additions and 561 deletions

View File

@ -2,8 +2,9 @@ using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WIQL;
public class Column
internal class Column
{
[JsonConstructor]
public Column(
string referenceName,
@ -16,7 +17,14 @@ public class Column
Url = url;
}
public string ReferenceName { get; set; } // { init; get; }
public string Name { get; set; } // { init; get; }
public string Url { get; set; } // { init; get; }
[JsonPropertyName("referenceName")] public string ReferenceName { get; }
[JsonPropertyName("name")] public string Name { get; }
[JsonPropertyName("url")] public string Url { get; }
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Column))]
internal partial class ColumnSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -2,8 +2,9 @@ using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WIQL;
public class Field
internal class Field
{
[JsonConstructor]
public Field(
string referenceName,
@ -16,7 +17,14 @@ public class Field
Url = url;
}
public string ReferenceName { get; set; } // { init; get; }
public string Name { get; set; } // { init; get; }
public string Url { get; set; } // { init; get; }
[JsonPropertyName("referenceName")] public string ReferenceName { get; }
[JsonPropertyName("name")] public string Name { get; }
[JsonPropertyName("url")] public string Url { get; }
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(Field))]
internal partial class FieldSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -3,8 +3,9 @@ using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WIQL;
public class Root
internal class Root
{
[JsonConstructor]
public Root(
string queryType,
@ -23,10 +24,17 @@ public class Root
WorkItems = workItems;
}
public string QueryType { get; set; } // { init; get; }
public string QueryResultType { get; set; } // { init; get; }
public DateTime AsOf { get; set; } // { init; get; }
public Column[] Columns { get; set; } // { init; get; }
public SortColumn[] SortColumns { get; set; } // { init; get; }
public WorkItem[] WorkItems { get; set; } // { init; get; }
[JsonPropertyName("queryType")] public string QueryType { get; }
[JsonPropertyName("queryResultType")] public string QueryResultType { get; }
[JsonPropertyName("asOf")] public DateTime AsOf { get; }
[JsonPropertyName("columns")] public Column[] Columns { get; }
[JsonPropertyName("sortColumns")] public SortColumn[] SortColumns { get; }
[JsonPropertyName("workItems")] public WorkItem[] WorkItems { get; }
}
[JsonSourceGenerationOptions(WriteIndented = true)] // PropertyNameCaseInsensitive = true
[JsonSerializable(typeof(Root))]
internal partial class RootSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -2,8 +2,9 @@ using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WIQL;
public class SortColumn
internal class SortColumn
{
[JsonConstructor]
public SortColumn(
Field field,
@ -14,6 +15,13 @@ public class SortColumn
Descending = descending;
}
public Field Field { get; set; } // { init; get; }
public bool Descending { get; set; } // { init; get; }
[JsonPropertyName("field")] public Field Field { get; }
[JsonPropertyName("descending")] public bool Descending { get; }
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(SortColumn))]
internal partial class SortColumnSourceGenerationContext : JsonSerializerContext
{
}

View File

@ -2,8 +2,9 @@ using System.Text.Json.Serialization;
namespace Adaptation.FileHandlers.json.WIQL;
public class WorkItem
internal class WorkItem
{
[JsonConstructor]
public WorkItem(
int id,
@ -14,6 +15,13 @@ public class WorkItem
Url = url;
}
public int Id { get; set; } // { init; get; }
public string Url { get; set; } // { init; get; }
[JsonPropertyName("id")] public int Id { get; }
[JsonPropertyName("url")] public string Url { get; }
}
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(WorkItem))]
internal partial class WIQLWorkItemSourceGenerationContext : JsonSerializerContext
{
}