I have a service that currently returns System.DataTable with this type of structure: Attached Data Table
I need to convert (transpose) this type of structure into model that looks like this:
[Required]
public string Field { get; set; }
[Required]
[StringLength(500)]
public string Identifier { get; set; }
public string? FieldValue { get; set; }
The final model is the database model. I am currently iterating thru datatable records. Works fine with 1000-10000 records, but when parsing 100000 and more it gets slow. If I can bulk stage the datatable structure in the database that would be great, but Field columns change, which makes it a bit more complicated.
Also, I can return DataFrame if the need be instead of DataTable. Transposing DataFrame I assume is easier, but the caveat here is that Identifier column needs to stay, rather than being transposed as Field columns.