You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
is it possible to map to objects containing nested objects when performing the mapping via column index?
public class EroeffnungbilanzWert
{
public string Kontonummer { get; set; }
public WertDaten Wertdaten { get; set; } = new();
}
public class WertDaten
{
public string Wert { get; set; }
public string Soll { get; set; }
public string Haben { get; set; }
}
By using this code the mapped values are not set to the nested object, but it runs without exception:
var excelMapper = new ExcelMapper(stream)
{
HeaderRow = true,
MinRowNumber = 2,
SkipBlankCells = false
};
excelMapper.AddMapping<EroeffnungbilanzWert>(5, s => s.Wertdaten.Soll);
This code results in an exception:
var excelMapper = new ExcelMapper(stream)
{
HeaderRow = false,
MinRowNumber = 2,
SkipBlankCells = false
};
excelMapper.AddMapping(4, s => s.Wertdaten.Soll);
But this code (not using nested object) works like expected:
var excelMapper = new ExcelMapper(stream)
{
HeaderRow = false,
MinRowNumber = 2,
SkipBlankCells = false
};
excelMapper.AddMapping(1, s => s.Kontonummer);
The text was updated successfully, but these errors were encountered:
Hello,
is it possible to map to objects containing nested objects when performing the mapping via column index?
By using this code the mapped values are not set to the nested object, but it runs without exception:
This code results in an exception:
var excelMapper = new ExcelMapper(stream)
{
HeaderRow = false,
MinRowNumber = 2,
SkipBlankCells = false
};
excelMapper.AddMapping(4, s => s.Wertdaten.Soll);
But this code (not using nested object) works like expected:
var excelMapper = new ExcelMapper(stream)
{
HeaderRow = false,
MinRowNumber = 2,
SkipBlankCells = false
};
excelMapper.AddMapping(1, s => s.Kontonummer);
The text was updated successfully, but these errors were encountered: