Let's say we have following DTO object which is representation of a record in a database:
public class UserDto
{
public int Id { get; set; }
public DateTime? ExpireOn { get; set; }
}
So Id property is not nullable and ExpireOn is. I have a problem to implement Domain objects based on Null Object Pattern, because I don't know how to implement not nullable ExpireOn property. What are best practical ways to do this?
I came up with this solution:
The question is if it can get any better?