Create Dynamic Enitty

SSinhg 286 Reputation points
2021-05-24T09:18:40.547+00:00

Hi,
I'm using Jira API 3

I have defined my entity class as

for e.g.

internal Class JiraIssues
{
public string expand { get; set; }
public int startAt { get; set; }
public int maxResults { get; set; }
public string CustomField_123 { get; set; }
public string CustomField_1234 { get; set; }
}

In future more fields can be added so I cannot have a class that has a predefined properties, is there a way to define properties dynamically?
I.e. I get Json response from Jira API then I iterate through and create properties to accommodate new fields
for e.g. Public string CustomerField_12345{ get; set;}

Any pointers or any reference article on these lines will be very helpful.

Thanks
S

https://your-domain.atlassian.net/rest/api/3/issue/{issueIdOrKey}' api-group-issues

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
9,972 questions
{count} votes