Creation of ADO Connection
This commit is contained in:
@ -3,7 +3,7 @@ using System.Text.Json.Serialization;
|
||||
|
||||
namespace Adaptation.FileHandlers.json.WorkItems;
|
||||
|
||||
public class WorkItem
|
||||
internal class WorkItem
|
||||
{
|
||||
|
||||
#nullable enable
|
||||
@ -70,68 +70,78 @@ public class WorkItem
|
||||
|
||||
public override string ToString() => $"{Id} - {WorkItemType} - {Title}";
|
||||
|
||||
public static Record Get(Record record, string? violation)
|
||||
public static WorkItem? GetWithOutRelations(WorkItem? workItem)
|
||||
{
|
||||
Record result;
|
||||
WorkItem workItem = new(record.WorkItem.ActivatedDate,
|
||||
record.WorkItem.AreaPath,
|
||||
record.WorkItem.AssignedTo,
|
||||
record.WorkItem.BusinessValue,
|
||||
record.WorkItem.ChangedDate,
|
||||
record.WorkItem.ClosedDate,
|
||||
record.WorkItem.CommentCount,
|
||||
record.WorkItem.CreatedDate,
|
||||
record.WorkItem.Description,
|
||||
record.WorkItem.Effort,
|
||||
record.WorkItem.Id,
|
||||
record.WorkItem.IterationPath,
|
||||
record.WorkItem.Parent,
|
||||
record.WorkItem.Priority,
|
||||
record.WorkItem.Relations,
|
||||
record.WorkItem.Requester,
|
||||
record.WorkItem.ResolvedDate,
|
||||
record.WorkItem.Revision,
|
||||
record.WorkItem.RiskReductionMinusOpportunityEnablement,
|
||||
record.WorkItem.StartDate,
|
||||
record.WorkItem.State,
|
||||
record.WorkItem.Tags,
|
||||
record.WorkItem.TargetDate,
|
||||
record.WorkItem.TimeCriticality,
|
||||
record.WorkItem.Title,
|
||||
record.WorkItem.Violation is null ? violation : record.WorkItem.Violation,
|
||||
record.WorkItem.WeightedShortestJobFirst,
|
||||
record.WorkItem.WorkItemType);
|
||||
result = new(workItem, record.Parent, Array.Empty<Record>());
|
||||
WorkItem? result = workItem is null ? null : new(workItem.ActivatedDate,
|
||||
workItem.AreaPath,
|
||||
workItem.AssignedTo,
|
||||
workItem.BusinessValue,
|
||||
workItem.ChangedDate,
|
||||
workItem.ClosedDate,
|
||||
workItem.CommentCount,
|
||||
workItem.CreatedDate,
|
||||
workItem.Description,
|
||||
workItem.Effort,
|
||||
workItem.Id,
|
||||
workItem.IterationPath,
|
||||
workItem.Parent,
|
||||
workItem.Priority,
|
||||
Array.Empty<Relation>(),
|
||||
workItem.Requester,
|
||||
workItem.ResolvedDate,
|
||||
workItem.Revision,
|
||||
workItem.RiskReductionMinusOpportunityEnablement,
|
||||
workItem.StartDate,
|
||||
workItem.State,
|
||||
workItem.Tags,
|
||||
workItem.TargetDate,
|
||||
workItem.TimeCriticality,
|
||||
workItem.Title,
|
||||
workItem.Violation,
|
||||
workItem.WeightedShortestJobFirst,
|
||||
workItem.WorkItemType);
|
||||
return result;
|
||||
}
|
||||
|
||||
public DateTime? ActivatedDate { get; set; }
|
||||
public string AreaPath { get; set; }
|
||||
public string? AssignedTo { get; set; }
|
||||
public long? 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 long? 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 long? RiskReductionMinusOpportunityEnablement { get; set; }
|
||||
public DateTime? StartDate { get; set; }
|
||||
public string State { get; set; }
|
||||
public string Tags { get; set; }
|
||||
public DateTime? TargetDate { get; set; }
|
||||
public long? TimeCriticality { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string? Violation { get; set; }
|
||||
public string WorkItemType { get; set; }
|
||||
public long? WeightedShortestJobFirst { get; set; }
|
||||
[JsonPropertyName("ActivatedDate")] public DateTime? ActivatedDate { get; }
|
||||
[JsonPropertyName("AreaPath")] public string AreaPath { get; }
|
||||
[JsonPropertyName("AssignedTo")] public string? AssignedTo { get; }
|
||||
[JsonPropertyName("BusinessValue")] public long? BusinessValue { get; }
|
||||
[JsonPropertyName("ChangedDate")] public DateTime ChangedDate { get; }
|
||||
[JsonPropertyName("ClosedDate")] public DateTime? ClosedDate { get; }
|
||||
[JsonPropertyName("CommentCount")] public int CommentCount { get; }
|
||||
[JsonPropertyName("CreatedDate")] public DateTime CreatedDate { get; }
|
||||
[JsonPropertyName("Description")] public string Description { get; }
|
||||
[JsonPropertyName("Effort")] public long? Effort { get; }
|
||||
[JsonPropertyName("Id")] public int Id { get; }
|
||||
[JsonPropertyName("IterationPath")] public string IterationPath { get; }
|
||||
[JsonPropertyName("Parent")] public int? Parent { get; }
|
||||
[JsonPropertyName("Priority")] public int? Priority { get; }
|
||||
[JsonPropertyName("Relations")] public Relation[]? Relations { get; }
|
||||
[JsonPropertyName("Requester")] public string? Requester { get; }
|
||||
[JsonPropertyName("ResolvedDate")] public DateTime? ResolvedDate { get; }
|
||||
[JsonPropertyName("Revision")] public int Revision { get; }
|
||||
[JsonPropertyName("RiskReductionMinusOpportunityEnablement")] public long? RiskReductionMinusOpportunityEnablement { get; }
|
||||
[JsonPropertyName("StartDate")] public DateTime? StartDate { get; }
|
||||
[JsonPropertyName("State")] public string State { get; }
|
||||
[JsonPropertyName("Tags")] public string Tags { get; }
|
||||
[JsonPropertyName("TargetDate")] public DateTime? TargetDate { get; }
|
||||
[JsonPropertyName("TimeCriticality")] public long? TimeCriticality { get; }
|
||||
[JsonPropertyName("Title")] public string Title { get; }
|
||||
[JsonPropertyName("Violation")] public string? Violation { get; }
|
||||
[JsonPropertyName("WeightedShortestJobFirst")] public long? WeightedShortestJobFirst { get; }
|
||||
[JsonPropertyName("WorkItemType")] public string WorkItemType { get; }
|
||||
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(WorkItem))]
|
||||
internal partial class WorkItemSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true)]
|
||||
[JsonSerializable(typeof(WorkItem[]))]
|
||||
internal partial class WorkItemCollectionSourceGenerationContext : JsonSerializerContext
|
||||
{
|
||||
}
|
Reference in New Issue
Block a user