given:
public class Customer
{
public int Id { get; set; }
public string FirstName { get; set; }
public DateTime Birthdate { get; set; }
}
You can add an additional property to the Customer called BirthDateStr.
public class Customer
{
public int Id { get; set; }
public string FirstName { get; set; }
public DateTime Birthdate { get; set; }
public string BirthDateStr
{
get
{
if (Birthdate != DateTime.MinValue)
return Birthdate.ToString();
else
return "";
}
}
Obviously, you could do whatever formatting you'd like to do on the BirthDateStr in the getter to make it match your format.