In short story, I want to make some universal generators for different formats (CSV, XLS, XLSX and JSON for now). Just to be clear, I will make different classes for all formats.
I have different models, with different fields. For example:
public class Agents
{
public int ID { get; set; }
public string Name { get; set; }
public string Email {get;set;}
}
public class IdCards
{
public int ID { get; set; }
public int MaleTotal { get; set; }
public int FemaleTotal { get; set; }
}
And I want to get tables that look like this for english:
Agent
:
|Name |Email |
| --- | --- |
| Sta |[email protected] |
|Danny|[email protected]|
|Elle |[email protected]|
IdCards
:
|Men|Women|
|---|--- |
|12 |13 |
|11 |14 |
|120|111 |
and for french:
Agent
:
|Nom |E-mail |
| --- | --- |
| Sta |[email protected] |
|Danny|[email protected]|
|Elle |[email protected]|
IdCards
:
|Hommes|Femmes|
| --- | --- |
|12 |13 |
|11 |14 |
|120 |111 |
Question is, how to prepare this models so I can get variable name as a column name?