I am attempting to map these complex types using ValueInjecter but the mapped object all of the properties are null.
DTO
public class HardwareSettingsDto
{
public HardwareSettingsDto()
{
EmailAlertSettings = new EmailAlertSettingsDto();
CpuMonitoring = new CpuMonitoringDto();
NetworkMonitoring = new NetworkMonitoringDto();
}
// I wont include the below classes but they contain property types of int, string, bool etc.
public CpuMonitoringDto CpuMonitoring { get; set; }
public NetworkMonitoringDto NetworkMonitoring { get; set; }
public List<DriveSettingsDto> Drives { get; set; }
public EmailAlertSettingsDto EmailAlertSettings { get; set; }
}
Entity
public class HardwareSettings
{
public HardwareSettings()
{
EmailAlertSettings = new EmailAlertSettings();
CpuMonitoring = new CpuMonitoring();
NetworkMonitoring = new NetworkMonitoring();
}
public CpuMonitoring CpuMonitoring { get; set; }
public NetworkMonitoring NetworkMonitoring { get; set; }
public List<DriveSettings> Drives { get; set; }
public EmailAlertSettings EmailAlertSettings { get; set; }
}
I cannot seem to map them back and forth DTO -> Entity and then Entity -> DTO as everything is null.