kevbite/CompaniesHouse.NET

Implement a way to expose the display names for enum values

kevbite opened this issue · 0 comments

Companies House have a list of enum values to their display name representation. It'd be good if the following was possible:

var result = await client.GetCompanyProfileAsync("10440441");

// England/Wales
var displayName = result.Data.GetDisplayName(x =>x.Jurisdiction);
Console.WriteLine(displayName);

We could do this by having [DisplayName] attributes on the enum values with the corresponding values in the yaml file (https://raw.githubusercontent.com/companieshouse/api-enumerations/master/constants.yml).

Follow up enhancement from issue #156