When mapping inner object to nullable property got property default value instead of null when the inner object is null
Example:
class Program
{
static void Main(string[] args)
{
var result = new Child().Adapt<ChildResource>();
Console.WriteLine(result.ParentId); //result.ParentId should be null not empty Guid
}
}
public class Parent
{
public Guid Id { get; set; }
}
public class Child
{
public Guid Id { get; set; }
public Parent Parent { get; set; }
}
public class ChildResource
{
public Guid Id { get; set; }
public Guid? ParentId { get; set; }
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4