I have these two lines of code:
result.birthdateSpecified = (someData.BirthDate != null || false);
result.birthdate = someData.BirthDate as DateTime;
I'd like to be able to set the result.birthdate to the someDate.BirthDate, only if it exists, in a single line. So that I don't have to write any if statement. Just wondering if it's possible?
FYI - result.birthDate is a DateTime and someData.BirthDate is a DateTime? (nullable)
I know I can't cast it with 'as' but not sure if there is something else I can use?