diff --git a/Adaptation/FileHandlers/json/FileRead.cs b/Adaptation/FileHandlers/json/FileRead.cs index 52951df..9a7e786 100644 --- a/Adaptation/FileHandlers/json/FileRead.cs +++ b/Adaptation/FileHandlers/json/FileRead.cs @@ -211,7 +211,7 @@ public class FileRead : Shared.FileRead, IFileRead private static int? GetIdFromUrlIfChild(Relation relation) { int? result; - string[] segments = relation.Attributes.Name != "Child" ? Array.Empty() : relation.URL.Split('/'); + string[] segments = relation?.Attributes is null || relation.Attributes.Name != "Child" ? Array.Empty() : relation.URL.Split('/'); if (segments.Length < 2) result = null; else diff --git a/Adaptation/FileHandlers/json/WorkItems/Attribute.cs b/Adaptation/FileHandlers/json/WorkItems/Attribute.cs index bdd3e5f..6aa2051 100644 --- a/Adaptation/FileHandlers/json/WorkItems/Attribute.cs +++ b/Adaptation/FileHandlers/json/WorkItems/Attribute.cs @@ -15,7 +15,7 @@ public class Attribute Name = name; } - public bool IsLocked { get; set; } // { init; get; } - public string Name { get; set; } // { init; get; } + [JsonPropertyName("isLocked")] public bool IsLocked { get; set; } + [JsonPropertyName("name")] public string Name { get; set; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/CommentVersionRef.cs b/Adaptation/FileHandlers/json/WorkItems/CommentVersionRef.cs index 2cc4c8b..1ed91d3 100644 --- a/Adaptation/FileHandlers/json/WorkItems/CommentVersionRef.cs +++ b/Adaptation/FileHandlers/json/WorkItems/CommentVersionRef.cs @@ -16,12 +16,8 @@ public class CommentVersionRef URL = url; } - [JsonPropertyName("commentId")] - public int CommentId { get; } // { init; get; } + [JsonPropertyName("commentId")] public int CommentId { get; } // { init; get; } + [JsonPropertyName("url")] public string URL { get; } // { init; get; } + [JsonPropertyName("version")] public int Version { get; } // { init; get; } - [JsonPropertyName("version")] - public int Version { get; } // { init; get; } - - [JsonPropertyName("url")] - public string URL { get; } // { init; get; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/Links.cs b/Adaptation/FileHandlers/json/WorkItems/Links.cs index 522a2eb..73dd5d5 100644 --- a/Adaptation/FileHandlers/json/WorkItems/Links.cs +++ b/Adaptation/FileHandlers/json/WorkItems/Links.cs @@ -9,6 +9,5 @@ public class Links Avatar avatar ) => Avatar = avatar; - [JsonPropertyName("avatar")] - public Avatar Avatar { get; } + [JsonPropertyName("avatar")] public Avatar Avatar { get; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/Relation.cs b/Adaptation/FileHandlers/json/WorkItems/Relation.cs index d0ff8c1..b1f2366 100644 --- a/Adaptation/FileHandlers/json/WorkItems/Relation.cs +++ b/Adaptation/FileHandlers/json/WorkItems/Relation.cs @@ -17,8 +17,8 @@ public class Relation Attributes = attributes; } - public string Rel { get; set; } // { init; get; } - public string URL { get; set; } // { init; get; } - public Attribute Attributes { get; set; } // { init; get; } + [JsonPropertyName("attributes")] public Attribute Attributes { get; set; } + [JsonPropertyName("rel")] public string Rel { get; set; } + [JsonPropertyName("url")] public string URL { get; set; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/SystemAssignedTo.cs b/Adaptation/FileHandlers/json/WorkItems/SystemAssignedTo.cs index 6a1d58f..8050648 100644 --- a/Adaptation/FileHandlers/json/WorkItems/SystemAssignedTo.cs +++ b/Adaptation/FileHandlers/json/WorkItems/SystemAssignedTo.cs @@ -24,24 +24,12 @@ public class SystemAssignedTo Descriptor = descriptor; } - [JsonPropertyName("displayName")] - public string DisplayName { get; } + [JsonPropertyName("_links")] public Links Links { get; } + [JsonPropertyName("descriptor")] public string Descriptor { get; } + [JsonPropertyName("displayName")] public string DisplayName { get; } + [JsonPropertyName("id")] public string Id { get; } + [JsonPropertyName("imageUrl")] public string ImageUrl { get; } + [JsonPropertyName("uniqueName")] public string UniqueName { get; } + [JsonPropertyName("url")] public string Url { get; } - [JsonPropertyName("url")] - public string Url { get; } - - [JsonPropertyName("_links")] - public Links Links { get; } - - [JsonPropertyName("id")] - public string Id { get; } - - [JsonPropertyName("uniqueName")] - public string UniqueName { get; } - - [JsonPropertyName("imageUrl")] - public string ImageUrl { get; } - - [JsonPropertyName("descriptor")] - public string Descriptor { get; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/SystemChangedBy.cs b/Adaptation/FileHandlers/json/WorkItems/SystemChangedBy.cs index 84e3eb9..9fcfe29 100644 --- a/Adaptation/FileHandlers/json/WorkItems/SystemChangedBy.cs +++ b/Adaptation/FileHandlers/json/WorkItems/SystemChangedBy.cs @@ -24,24 +24,12 @@ public class SystemChangedBy Descriptor = descriptor; } - [JsonPropertyName("displayName")] - public string DisplayName { get; } + [JsonPropertyName("_links")] public Links Links { get; } + [JsonPropertyName("descriptor")] public string Descriptor { get; } + [JsonPropertyName("displayName")] public string DisplayName { get; } + [JsonPropertyName("id")] public string Id { get; } + [JsonPropertyName("imageUrl")] public string ImageUrl { get; } + [JsonPropertyName("uniqueName")] public string UniqueName { get; } + [JsonPropertyName("url")] public string Url { get; } - [JsonPropertyName("url")] - public string Url { get; } - - [JsonPropertyName("_links")] - public Links Links { get; } - - [JsonPropertyName("id")] - public string Id { get; } - - [JsonPropertyName("uniqueName")] - public string UniqueName { get; } - - [JsonPropertyName("imageUrl")] - public string ImageUrl { get; } - - [JsonPropertyName("descriptor")] - public string Descriptor { get; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/SystemCreatedBy.cs b/Adaptation/FileHandlers/json/WorkItems/SystemCreatedBy.cs index 7b76091..2d8d7a6 100644 --- a/Adaptation/FileHandlers/json/WorkItems/SystemCreatedBy.cs +++ b/Adaptation/FileHandlers/json/WorkItems/SystemCreatedBy.cs @@ -24,24 +24,12 @@ public class SystemCreatedBy Descriptor = descriptor; } - [JsonPropertyName("displayName")] - public string DisplayName { get; } + [JsonPropertyName("_links")] public Links Links { get; } + [JsonPropertyName("descriptor")] public string Descriptor { get; } + [JsonPropertyName("displayName")] public string DisplayName { get; } + [JsonPropertyName("id")] public string Id { get; } + [JsonPropertyName("imageUrl")] public string ImageUrl { get; } + [JsonPropertyName("uniqueName")] public string UniqueName { get; } + [JsonPropertyName("url")] public string Url { get; } - [JsonPropertyName("url")] - public string Url { get; } - - [JsonPropertyName("_links")] - public Links Links { get; } - - [JsonPropertyName("id")] - public string Id { get; } - - [JsonPropertyName("uniqueName")] - public string UniqueName { get; } - - [JsonPropertyName("imageUrl")] - public string ImageUrl { get; } - - [JsonPropertyName("descriptor")] - public string Descriptor { get; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/Value.cs b/Adaptation/FileHandlers/json/WorkItems/Value.cs index 17c66b9..42a500f 100644 --- a/Adaptation/FileHandlers/json/WorkItems/Value.cs +++ b/Adaptation/FileHandlers/json/WorkItems/Value.cs @@ -22,21 +22,10 @@ public class Value Url = url; } - [JsonPropertyName("id")] - public int Id { get; } - - [JsonPropertyName("rev")] - public int Rev { get; } - - [JsonPropertyName("fields")] - public Fields Fields { get; } - - [JsonPropertyName("relations")] - public Relation[] Relations { get; } - - [JsonPropertyName("commentVersionRef")] - public CommentVersionRef CommentVersionRef { get; } - - [JsonPropertyName("url")] - public string Url { get; } + [JsonPropertyName("commentVersionRef")] public CommentVersionRef CommentVersionRef { get; } + [JsonPropertyName("fields")] public Fields Fields { get; } + [JsonPropertyName("id")] public int Id { get; } + [JsonPropertyName("relations")] public Relation[] Relations { get; } + [JsonPropertyName("rev")] public int Rev { get; } + [JsonPropertyName("url")] public string Url { get; } } \ No newline at end of file diff --git a/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs b/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs index 59d3c99..8f410df 100644 --- a/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs +++ b/Adaptation/FileHandlers/json/WorkItems/WorkItem.cs @@ -64,31 +64,31 @@ public class WorkItem WeightedShortestJobFirst = weightedShortestJobFirst; } - public string AreaPath { get; set; } // { init; get; } - public string? AssignedTo { get; set; } // { init; get; } - public int? BusinessValue { get; set; } // { init; get; } - public DateTime ChangedDate { get; set; } // { init; get; } - public DateTime? ClosedDate { get; set; } // { init; get; } - public int CommentCount { get; set; } // { init; get; } - public DateTime CreatedDate { get; set; } // { init; get; } - public string Description { get; set; } // { init; get; } - public float? Effort { get; set; } // { init; get; } - public int Id { get; set; } // { init; get; } - public string IterationPath { get; set; } // { init; get; } - public int? Parent { get; set; } // { init; get; } - public int? Priority { get; set; } // { init; get; } - public Relation[]? Relations { get; set; } // { init; get; } - public string? Requester { get; set; } // { init; get; } - public DateTime? ResolvedDate { get; set; } // { init; get; } - public int Revision { get; set; } // { init; get; } - public int? RiskReductionMinusOpportunityEnablement { get; set; } // { init; get; } - public DateTime? StartDate { get; set; } // { init; get; } - public string State { get; set; } // { init; get; } - public string Tags { get; set; } // { init; get; } - public DateTime? TargetDate { get; set; } // { init; get; } - public float? TimeCriticality { get; set; } // { init; get; } - public string Title { get; set; } // { init; get; } - public string WorkItemType { get; set; } // { init; get; } - public float? WeightedShortestJobFirst { get; set; } // { init; get; } + public string AreaPath { get; set; } + public string? AssignedTo { get; set; } + public int? BusinessValue { get; set; } + public DateTime ChangedDate { get; set; } + public DateTime? ClosedDate { get; set; } + public int CommentCount { get; set; } + public DateTime CreatedDate { get; set; } + public string Description { get; set; } + public float? Effort { get; set; } + public int Id { get; set; } + public string IterationPath { get; set; } + public int? Parent { get; set; } + public int? Priority { get; set; } + public Relation[]? Relations { get; set; } + public string? Requester { get; set; } + public DateTime? ResolvedDate { get; set; } + public int Revision { get; set; } + public int? RiskReductionMinusOpportunityEnablement { get; set; } + public DateTime? StartDate { get; set; } + public string State { get; set; } + public string Tags { get; set; } + public DateTime? TargetDate { get; set; } + public float? TimeCriticality { get; set; } + public string Title { get; set; } + public string WorkItemType { get; set; } + public float? WeightedShortestJobFirst { get; set; } } \ No newline at end of file