CSharp · Console
using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
//Console.WriteLine(nameof(Product.Indicators));
Product product = new Product();
Console.WriteLine( NameOfArray(new{ product.Indicators, product.ProductComputeParams, product.ProductDetails }));
}
public static string NameOfArray(object toDisplay)
{
List<string> values = new List<string>();
foreach (var pi in toDisplay.GetType().GetProperties())
{
values.Add(pi.Name);
}
return string.Join(",", values);
}
}
public class Product
{
public object Indicators {get; set;}
public object ProductComputeParams {get; set;}
public object ProductDetails {get; set;}
public object ProductRecallValues {get; set;}
}