I am working on an ASP.NET MVC application developing domain models using (testing) the new EF Code First feature.
I have an Activity object that may or may not have a deadline, what is the best way to approach it?
1 property:
public DateTime? Deadline {get; set;} and check vs null before using
or
2 properties:
public DateTime Deadline {get; set;} public bool HasDeadline {get; set;}
At first I thought about the first option, but then I started to think that maybe the second option would be better with respect to the database ...
Are there any recommendations on this?
c # asp.net-mvc data-modeling code-first
Francisco noriega
source share