I often use the Attribute DisplayName to show my jobs in a method-like style:
MethodName ( parameter1, parameter2, …)
This works well with most parameter-types, but not with arrays.
Arrays.ToString() does not work well
With a DisplayName annotated like this:
[DisplayName("Export({0})")]
public static void Export(string[] array, IJobCancellationToken cancellationToken, PerformContext hangfireContext)
{
}
The result on the dashboard is like this:
Export(System.String[])
How can I make a custom attribute that allows me to show array-values in the dashboard?
Preferably as a list of all elements:
string.Join(", ", array);
or if the number of elements is too long, the count og elements in the list.