I'm not familiar with C#4.0, but in c#3.5 I'd use overloading;
public void Problem()
{
Problem(DateTime.MaxValue);
}
public void Problem(DateTime dt)
{
}
And call it with either:
Problem(); //defaults to maxvalue
Problem(myDateTime); //uses input value
Edit:
Just to put an answer to some of the comments;
public class FooBar
{
public bool Problem()
{
//creates a default person object
return Problem(new Person());
}
public void Problem(Person person)
{
//Some logic here
return true;
}
}
public class Person
{
public string Name { get; private set; }
public DateTime DOB { get; private set; }
public Person(string name, DateTime dob)
{
this.Name = name;
this.DOB = dob;
}
/// <summary>
/// Default constructor
/// </summary>
public Person()
{
Name = "Michael";
DOB = DateTime.Parse("1980-07-21");
}
}